From ec18ca6778afde54d02f109b86694eabf8e3d6a5 Mon Sep 17 00:00:00 2001 From: "tommi@chromium.org" Date: Thu, 2 Sep 2010 13:39:50 +0000 Subject: Pin the DLL if we make any patches instead of doing it from the Bho that does not apply the patches itself. TEST=There should be no changes but we were seeing some potential problems in house with other proprietary browser extensions. BUG=none Review URL: http://codereview.chromium.org/3359001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58350 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/bho.cc | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'chrome_frame/bho.cc') diff --git a/chrome_frame/bho.cc b/chrome_frame/bho.cc index f8d44e6..5e0c7f6 100644 --- a/chrome_frame/bho.cc +++ b/chrome_frame/bho.cc @@ -312,34 +312,12 @@ void Bho::ProcessOptInUrls(IWebBrowser2* browser, BSTR url) { } } -namespace { -// Utility function that prevents the current module from ever being unloaded. -void PinModule() { - FilePath module_path; - if (PathService::Get(base::FILE_MODULE, &module_path)) { - HMODULE unused; - if (!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_PIN, - module_path.value().c_str(), &unused)) { - NOTREACHED() << "Failed to pin module " << module_path.value().c_str() - << " , last error: " << GetLastError(); - } - } else { - NOTREACHED() << "Could not get module path."; - } -} -} // namespace - bool PatchHelper::InitializeAndPatchProtocolsIfNeeded() { bool ret = false; _pAtlModule->m_csStaticDataInitAndTypeInfo.Lock(); if (state_ == UNKNOWN) { - // If we're going to start patching things for reals, we'd better make sure - // that we stick around for ever more: - if (!IsUnpinnedMode()) - PinModule(); - ProtocolPatchMethod patch_method = GetPatchMethod(); if (patch_method == PATCH_METHOD_INET_PROTOCOL) { g_trans_hooks.InstallHooks(); -- cgit v1.1