Remove *LoadContextHostBinder (#21342)
authorSteve MacLean <stmaclea@microsoft.com>
Tue, 4 Dec 2018 07:27:31 +0000 (02:27 -0500)
committerJan Kotas <jkotas@microsoft.com>
Tue, 4 Dec 2018 07:27:31 +0000 (23:27 -0800)
src/vm/appdomain.hpp
src/vm/assemblynative.cpp
src/vm/ceeload.cpp
src/vm/compile.cpp

index cb9cab2..389ce47 100644 (file)
@@ -3234,109 +3234,6 @@ private:
 
 public:
 
-private:
-    // This is the root-level default load context root binder. If null, then
-    // the Fusion binder is used; otherwise this binder is used.
-    ReleaseHolder<ICLRPrivBinder> m_pLoadContextHostBinder;
-
-    // -------------------------
-    // IMPORTANT!
-    // The shared and designer context binders are ONLY to be used in tool
-    // scenarios. There are known issues where use of these binders will
-    // cause application crashes, and interesting behaviors.
-    // -------------------------
-    
-    // This is the default designer shared context root binder.
-    // This is used as the parent binder for ImmersiveDesignerContextBinders
-    ReleaseHolder<ICLRPrivBinder> m_pSharedContextHostBinder;
-
-    // This is the current context root binder.
-    // Normally, this variable is immutable for appdomain lifetime, but in designer scenarios
-    // it may be replaced by designer context binders
-    Volatile<ICLRPrivBinder *>    m_pCurrentContextHostBinder;
-
-public:
-    // Returns the current hosted binder, or null if none available.
-    inline
-    ICLRPrivBinder * GetCurrentLoadContextHostBinder() const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return m_pCurrentContextHostBinder;
-    }
-
-    // Returns the shared context binder, or null if none available.
-    inline
-    ICLRPrivBinder * GetSharedContextHostBinder() const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return m_pSharedContextHostBinder;
-    }
-
-    // Returns the load context binder, or null if none available.
-    inline
-    ICLRPrivBinder * GetLoadContextHostBinder() const
-    {
-        LIMITED_METHOD_CONTRACT;
-        return m_pLoadContextHostBinder;
-    }
-
-#ifndef DACCESS_COMPILE
-
-    // This is only called from the ImmersiveDesignerContext code
-    // It is protected with a managed monitor lock
-    inline
-    void SetSharedContextHostBinder(ICLRPrivBinder * pBinder)
-    {
-        LIMITED_METHOD_CONTRACT;
-        pBinder->AddRef();
-        m_pSharedContextHostBinder = pBinder;
-    }
-
-    // This is called from CorHost2's implementation of ICLRPrivRuntime::CreateAppDomain.
-    // Should only be called during AppDomain creation.
-    inline
-    void SetLoadContextHostBinder(ICLRPrivBinder * pBinder)
-    {
-        LIMITED_METHOD_CONTRACT;
-        pBinder->AddRef();
-        m_pLoadContextHostBinder = m_pCurrentContextHostBinder = pBinder;
-    }
-
-    inline
-    void SetCurrentContextHostBinder(ICLRPrivBinder * pBinder)
-    {
-        CONTRACTL
-        {
-            THROWS;
-            GC_TRIGGERS;
-        }
-        CONTRACTL_END;
-
-        LockHolder lh(this);
-
-#ifdef FEATURE_COMINTEROP
-        if (m_pNameToTypeMap != nullptr)
-        {
-            delete m_pNameToTypeMap;
-            m_pNameToTypeMap = nullptr;
-        }
-
-        m_vNameToTypeMapVersion++;
-#endif
-
-        m_pCurrentContextHostBinder = pBinder;
-    }
-
-#endif // DACCESS_COMPILE
-
-    // Indicates that a hosted binder is present.
-    inline
-    bool HasLoadContextHostBinder()
-    {
-        LIMITED_METHOD_CONTRACT;
-        return m_pLoadContextHostBinder != nullptr;
-    }
-
     class ComInterfaceReleaseList
     {
         SArray<IUnknown *> m_objects;
index 1672240..2f89be1 100644 (file)
@@ -75,10 +75,6 @@ FCIMPL7(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAF
     }
     else
     {
-        // name specified, if immersive ignore the codebase
-        if (GetThread()->GetDomain()->HasLoadContextHostBinder())
-            gc.codeBase = NULL;
-
         // Compute parent assembly
         if (gc.requestingAssembly == NULL)
         {
@@ -95,7 +91,6 @@ FCIMPL7(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAF
         {
             pParentAssembly= pRefAssembly->GetDomainAssembly();
         }
-
     }
 
     // Initialize spec
index 058f4a4..ec8e3ae 100644 (file)
@@ -5032,35 +5032,6 @@ Module::GetAssemblyIfLoaded(
                 _ASSERTE(szWinRtClassName != NULL);
                 
                 CLRPrivBinderWinRT * pWinRtBinder = pAppDomainExamine->GetWinRtBinder();
-                if (pWinRtBinder == nullptr)
-                {   // We are most likely in AppX mode (calling AppX::IsAppXProcess() for verification is painful in DACCESS)
-#ifndef DACCESS_COMPILE
-                    // Note: We should also look
-                    // Check designer binding context present (only in AppXDesignMode)
-                    ICLRPrivBinder * pCurrentBinder = pAppDomainExamine->GetLoadContextHostBinder();
-                    if (pCurrentBinder != nullptr)
-                    {   // We have designer binding context, look for the type in it
-                        ReleaseHolder<ICLRPrivWinRtTypeBinder> pCurrentWinRtTypeBinder;
-                        HRESULT hr = pCurrentBinder->QueryInterface(__uuidof(ICLRPrivWinRtTypeBinder), (void **)&pCurrentWinRtTypeBinder);
-                        
-                        // The binder should be an instance of code:CLRPrivBinderAppX class that implements the interface
-                        _ASSERTE(SUCCEEDED(hr) && (pCurrentWinRtTypeBinder != nullptr));
-                        
-                        if (SUCCEEDED(hr))
-                        {
-                            ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE();
-                            pAssembly = (Assembly *)pCurrentWinRtTypeBinder->FindAssemblyForWinRtTypeIfLoaded(
-                                (void *)pAppDomainExamine, 
-                                szWinRtNamespace, 
-                                szWinRtClassName);
-                        }
-                    }
-#endif //!DACCESS_COMPILE
-                    if (pAssembly == nullptr)
-                    {   
-                    }
-                }
-                
                 if (pWinRtBinder != nullptr)
                 {
                     ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE();
index 721f354..1bd75fc 100644 (file)
@@ -363,7 +363,7 @@ HRESULT CEECompileInfo::LoadAssemblyByPath(
 #endif //FEATURE_COMINTEROP
 
             // If there is a host binder then use it to bind the assembly.
-            if (pDomain->HasLoadContextHostBinder() || isWinRT)
+            if (isWinRT)
             {
                 pAssemblyHolder = pDomain->BindAssemblySpec(&spec, TRUE, FALSE);
             }