Rename interoplibinterface.cpp -> interoplibinterface_comwrappers.cpp (#56921)
authorElinor Fung <elfung@microsoft.com>
Thu, 5 Aug 2021 19:44:13 +0000 (12:44 -0700)
committerGitHub <noreply@github.com>
Thu, 5 Aug 2021 19:44:13 +0000 (12:44 -0700)
src/coreclr/interop/comwrappers.cpp
src/coreclr/interop/referencetrackertypes.hpp
src/coreclr/interop/trackerobjectmanager.cpp
src/coreclr/vm/CMakeLists.txt
src/coreclr/vm/interoplibinterface_comwrappers.cpp [moved from src/coreclr/vm/interoplibinterface.cpp with 99% similarity]
src/coreclr/vm/weakreferencenative.cpp

index a4afa67..5600b6a 100644 (file)
@@ -9,7 +9,6 @@
 #include <new> // placement new
 #endif // _WIN32
 
-
 using OBJECTHANDLE = InteropLib::OBJECTHANDLE;
 using AllocScenario = InteropLibImports::AllocScenario;
 using TryInvokeICustomQueryInterfaceResult = InteropLibImports::TryInvokeICustomQueryInterfaceResult;
index 6e703a9..ba5adc8 100644 (file)
@@ -8,7 +8,7 @@
 
 // Documentation found at https://docs.microsoft.com/windows/win32/api/windows.ui.xaml.hosting.referencetracker/
 
-//64bd43f8-bfee-4ec4-b7eb-2935158dae21
+// 64bd43f8-bfee-4ec4-b7eb-2935158dae21
 const GUID IID_IReferenceTrackerTarget = { 0x64bd43f8, 0xbfee, 0x4ec4, { 0xb7, 0xeb, 0x29, 0x35, 0x15, 0x8d, 0xae, 0x21} };
 
 class DECLSPEC_UUID("64bd43f8-bfee-4ec4-b7eb-2935158dae21") IReferenceTrackerTarget : public IUnknown
@@ -46,7 +46,7 @@ public:
     STDMETHOD(FoundTrackerTarget)(_In_ IReferenceTrackerTarget* target) = 0;
 };
 
-//11d3b13a-180e-4789-a8be-7712882893e6
+// 11d3b13a-180e-4789-a8be-7712882893e6
 const GUID IID_IReferenceTracker = { 0x11d3b13a, 0x180e, 0x4789, { 0xa8, 0xbe, 0x77, 0x12, 0x88, 0x28, 0x93, 0xe6} };
 
 class DECLSPEC_UUID("11d3b13a-180e-4789-a8be-7712882893e6") IReferenceTracker : public IUnknown
index 6f4bebc..0a199b7 100644 (file)
@@ -9,14 +9,13 @@ using RuntimeCallContext = InteropLibImports::RuntimeCallContext;
 
 namespace
 {
-
-    //29a71c6a-3c42-4416-a39d-e2825a07a773
+    // 29a71c6a-3c42-4416-a39d-e2825a07a773
     const GUID IID_IReferenceTrackerHost = { 0x29a71c6a, 0x3c42, 0x4416, { 0xa3, 0x9d, 0xe2, 0x82, 0x5a, 0x7, 0xa7, 0x73} };
 
-    //3cf184b4-7ccb-4dda-8455-7e6ce99a3298
+    // 3cf184b4-7ccb-4dda-8455-7e6ce99a3298
     const GUID IID_IReferenceTrackerManager = { 0x3cf184b4, 0x7ccb, 0x4dda, { 0x84, 0x55, 0x7e, 0x6c, 0xe9, 0x9a, 0x32, 0x98} };
 
-    //04b3486c-4687-4229-8d14-505ab584dd88
+    // 04b3486c-4687-4229-8d14-505ab584dd88
     const GUID IID_IFindReferenceTargetsCallback = { 0x04b3486c, 0x4687, 0x4229, { 0x8d, 0x14, 0x50, 0x5a, 0xb5, 0x84, 0xdd, 0x88} };
 
     // In order to minimize the impact of a constructor running on module load,
index d0f9652..5cb683b 100644 (file)
@@ -562,23 +562,22 @@ list(APPEND VM_SOURCES_WKS
 list(APPEND VM_HEADERS_WKS
     interoplibinterface.h
 )
-if(FEATURE_COMWRAPPERS OR FEATURE_OBJCMARSHAL)
-    if (FEATURE_COMWRAPPERS)
-        list(APPEND VM_SOURCES_WKS
-            interoplibinterface.cpp
-            rcwrefcache.cpp
-        )
-        list(APPEND VM_HEADERS_WKS
-            rcwrefcache.h
-        )
-    endif (FEATURE_COMWRAPPERS)
 
-    if (FEATURE_OBJCMARSHAL)
-        list(APPEND VM_SOURCES_WKS
-            interoplibinterface_objc.cpp
-        )
-    endif (FEATURE_OBJCMARSHAL)
-endif(FEATURE_COMWRAPPERS OR FEATURE_OBJCMARSHAL)
+if(FEATURE_COMWRAPPERS)
+    list(APPEND VM_SOURCES_WKS
+        interoplibinterface_comwrappers.cpp
+        rcwrefcache.cpp
+    )
+    list(APPEND VM_HEADERS_WKS
+        rcwrefcache.h
+    )
+endif(FEATURE_COMWRAPPERS)
+
+if(FEATURE_OBJCMARSHAL)
+    list(APPEND VM_SOURCES_WKS
+        interoplibinterface_objc.cpp
+    )
+endif(FEATURE_OBJCMARSHAL)
 
 if(CLR_CMAKE_TARGET_WIN32)
 
similarity index 99%
rename from src/coreclr/vm/interoplibinterface.cpp
rename to src/coreclr/vm/interoplibinterface_comwrappers.cpp
index 746c228..030cabf 100644 (file)
 using CreateObjectFlags = InteropLib::Com::CreateObjectFlags;
 using CreateComInterfaceFlags = InteropLib::Com::CreateComInterfaceFlags;
 
-
 namespace
 {
-
     void* GetCurrentCtxCookieWrapper()
     {
         STATIC_CONTRACT_WRAPPER;
@@ -32,7 +30,6 @@ namespace
     #else
         return NULL;
     #endif // FEATURE_COMINTEROP_APARTMENT_SUPPORT
-
     }
 
     // This class is used to track the external object within the runtime.
index 1354f35..ab2b6f9 100644 (file)
@@ -148,12 +148,11 @@ NativeComWeakHandleInfo* GetComWeakReferenceInfo(OBJECTREF* pObject)
     else
 #endif
     {
-#ifdef FEATURE_COMWRAPPERS        
+#ifdef FEATURE_COMWRAPPERS
         pWeakReferenceSource = reinterpret_cast<IWeakReferenceSource*>(ComWrappersNative::GetIdentityForObject(pObject, IID_IWeakReferenceSource, &wrapperId));
-#endif    
+#endif
     }
 
-
     if (pWeakReferenceSource == nullptr)
     {
         return nullptr;
@@ -771,7 +770,6 @@ NOINLINE void SetWeakReferenceTarget(WEAKREFERENCEREF weakReference, OBJECTREF t
     NewHolder<NativeComWeakHandleInfo> comWeakHandleInfo(GetComWeakReferenceInfo(&target));
 #endif // FEATURE_COMINTEROP || FEATURE_COMWRAPPERS
 
-
     WeakHandleSpinLockHolder handle(AcquireWeakHandleSpinLock(weakReference), &weakReference);
     GCX_NOTRIGGER();