diff options
author | Tijoy Tom Kalathiparambil <tijoytk@microsoft.com> | 2017-09-08 23:29:40 +0300 |
---|---|---|
committer | Tijoy Tom Kalathiparambil <tijoytk@microsoft.com> | 2017-09-08 23:29:40 +0300 |
commit | 766ab35a11e89fc6dab1f7a193db0d42b023a1fd (patch) | |
tree | e24daa9d286bcc3a240b9d5e254d9fb2c15b2f27 /src/System.Private.Interop | |
parent | 0c314e16df127b3bd27b58916c79695a62bb850d (diff) |
Disable DebuggerBrowsable for __ComObject fields and properties . We were
showing implementation details in the debugger which is of no use for the end user .
Also this improved func eval perf since we avoid unnecessary evaluations.
[tfs-changeset: 1673187]
Diffstat (limited to 'src/System.Private.Interop')
-rw-r--r-- | src/System.Private.Interop/src/Shared/__ComObject.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/System.Private.Interop/src/Shared/__ComObject.cs b/src/System.Private.Interop/src/Shared/__ComObject.cs index e0856f8bb..bcf57430d 100644 --- a/src/System.Private.Interop/src/Shared/__ComObject.cs +++ b/src/System.Private.Interop/src/Shared/__ComObject.cs @@ -85,6 +85,7 @@ namespace System /// RCW Identity interface pointer + context /// This supports all the cross-apartment marshalling /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] ContextBoundInterfacePointer m_baseIUnknown; /// <summary> @@ -92,6 +93,7 @@ namespace System /// Note that this is not necessarily the identity IUnknown, which is why I name it "Base" IUnknown /// If this is default(IntPtr), this RCW is not initialized yet /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal IntPtr BaseIUnknown_UnsafeNoAddRef { get { return m_baseIUnknown.ComPointer_UnsafeNoAddRef; } } /// <summary> @@ -101,17 +103,20 @@ namespace System /// Typically you don't need to release as garbage collector will automatically take care of it /// But you can call Marshal.ReleaseComObject if you want explicit release it as early as possible /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] int m_refCount; /// <summary> /// Flags of this __ComObject. See ComObjectFlags for the possible value /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] ComObjectFlags m_flags; /// <summary> /// A reference to CCW /// This makes sure the lifetime of the CCW and this RCW is tied together in aggregation scenario /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] ComCallableObject m_outer; /// <summary> @@ -119,8 +124,10 @@ namespace System /// This is mostly used as a way to diagnose what the underlying COM object really is (if the vtbl /// is still there, of course) in case the COM object was destroyed due to an extra release /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] IntPtr m_savedIUnknownVtbl; + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal IntPtr SavedIUnknownVtbl { get { return m_savedIUnknownVtbl; } } /// <summary> @@ -130,6 +137,7 @@ namespace System /// Update managed debugger whenever field name/field type is changed. /// See CordbObjectValue::GetInterfaceData in debug\dbi\values.cpp /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal SimpleComInterfaceCacheItem[] m_cachedInterfaces; internal const int FIXED_CACHE_SIZE = 8; @@ -139,19 +147,23 @@ namespace System /// Update managed debugger whenever field name/field type is changed. /// See CordbObjectValue::GetInterfaceData in debug\dbi\values.cpp /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private AdditionalComInterfaceCacheContext[] m_additionalCachedInterfaces_dontAccessDirectly; // if m_additionalCachedInterfaces_dontAccessDirectly == CacheLocked, the cache is being updated and // cannot be read or written from another thread. We do this instead of using a "real" lock, to save space. + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private static readonly AdditionalComInterfaceCacheContext[] CacheLocked = new AdditionalComInterfaceCacheContext[0]; /// <summary> /// Finalizer helper object that does cleanup. /// See RCWFinalizer class for more details. /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private RCWFinalizer m_finalizer; #if !RHTESTCL && !CORECLR && !CORERT + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private static readonly System.Collections.Generic.Dictionary<RuntimeTypeHandle, RuntimeTypeHandle> s_DynamicRCWAdapters = new System.Collections.Generic.Dictionary<RuntimeTypeHandle, RuntimeTypeHandle>(); #endif @@ -165,18 +177,21 @@ namespace System /// Runtime class name of this WinRT __ComObject. This is helpful when you want to understand why /// you get back a __ComObject instead of a strongly-typed RCW /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal string m_runtimeClassName; /// <summary> /// sequential allocation ID of this COM object /// useful when you are debugging bugs where the program's behavior is deterministic /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal uint m_allocationId; /// <summary> /// Next allocation ID /// Typed as int to make sure InterlockedExchange.Add is happy /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal static int s_nextAllocationId; #endif @@ -184,6 +199,7 @@ namespace System /// Return allocation ID in debug build /// INTERNAL only - not in public contract /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] public uint AllocationId { get @@ -203,6 +219,7 @@ namespace System /// Only used in aggregation scenarios /// We only set the outer CCW during creation of managed object that derives from native /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal ComCallableObject Outer { get @@ -446,6 +463,7 @@ namespace System } } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private ComMarshalingType MarshalingType { get @@ -467,6 +485,7 @@ namespace System } } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private bool IsGCPressureSet { get @@ -480,6 +499,7 @@ namespace System /// The different mapping ranges are defined in GCMemoryPressureConstants /// </summary> #if ENABLE_WINRT + [DebuggerBrowsable(DebuggerBrowsableState.Never)] private int GCMemoryPressure { get @@ -639,6 +659,7 @@ namespace System /// Whether this __ComObject represents a Jupiter UI object that implements IJupiterObject for life /// time tracking purposes /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsJupiterObject { [GCCallback] @@ -651,6 +672,7 @@ namespace System /// <summary> /// Whether this RCW is used as a baseclass of a managed class. For example, MyButton: Button /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool ExtendsComObject { get @@ -677,6 +699,7 @@ namespace System /// in .NET Native (but not true in desktop CLR, where extends a COM object could mean either /// aggregation or containment, depending on whether the underlying COM objects supports it) /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsAggregated { get @@ -986,6 +1009,7 @@ namespace System /// <summary> /// Whether the RCW is free-threaded /// <summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsFreeThreaded { get @@ -997,6 +1021,7 @@ namespace System /// <summary> /// Whether the RCW is a duplicate RCW that is not saved in cache /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool IsDuplicate { get @@ -1008,6 +1033,7 @@ namespace System /// <summary> /// Returns the context cookie where this RCW is created /// </summary> + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal ContextCookie ContextCookie { get @@ -1016,6 +1042,7 @@ namespace System } } + [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal ComObjectFlags Flags { get |