diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 23:12:35 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 23:12:35 +0000 |
commit | a17930d85c1a30bcb97c793ba08d2e6ea019deb6 (patch) | |
tree | cfb4f8917856c46f038ff5a1420ebce4c9f53526 /chrome_frame/chrome_active_document.cc | |
parent | d37d93b349a3e5090ad2d7ea6ed44913384ed849 (diff) | |
download | chromium_src-a17930d85c1a30bcb97c793ba08d2e6ea019deb6.zip chromium_src-a17930d85c1a30bcb97c793ba08d2e6ea019deb6.tar.gz chromium_src-a17930d85c1a30bcb97c793ba08d2e6ea019deb6.tar.bz2 |
A number of poorly written IE BHO's crash IE if ChromeFrame is the currently loaded document.
This is because they expect ChromeFrame to implement interfaces like IHTMLDocument2 on the same
lines as regular IE documents. Currently in ChromeFrame we patch the invoke methods of these
BHO's prior to firing navigation events from ChromeFrame. However this is not enough as
these objects also crash for regular navigation events fired from IE when ChromeFrame is loaded.
We now don't fire navigation events for buggy BHO's if ChromeFrame is the current document.
The BuggyBho handler instance is now created once for the thread. We patch when we receive
navigation notifications from Chrome as before. When we receive a notification
on our patched event sink we check if CF is loaded and if yes skip the call.
Added helpers to chrome frame utils to check if CF is loaded in the current web browser instance.
BUG=55932
TEST=none
Review URL: http://codereview.chromium.org/6493002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_active_document.cc')
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 7e78931..2fc4a00 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -738,6 +738,19 @@ void ChromeActiveDocument::UpdateNavigationState( OLECMDEXECOPT_DODEFAULT, secure_lock_status.AsInput(), NULL); } + // A number of poorly written bho's crash in their event sink callbacks if + // chrome frame is the currently loaded document. This is because they expect + // chrome frame to implement interfaces like IHTMLDocument, etc. We patch the + // event sink's of these bho's and don't invoke the event sink if chrome + // frame is the currently loaded document. + if (GetConfigBool(true, kEnableBuggyBhoIntercept)) { + ScopedComPtr<IWebBrowser2> wb2; + DoQueryService(SID_SWebBrowserApp, m_spClientSite, wb2.Receive()); + if (wb2 && buggy_bho::BuggyBhoTls::GetInstance()) { + buggy_bho::BuggyBhoTls::GetInstance()->PatchBuggyBHOs(wb2); + } + } + // Ideally all navigations should come to Chrome Frame so that we can call // BeforeNavigate2 on installed BHOs and give them a chance to cancel the // navigation. However, in practice what happens is as below: @@ -768,15 +781,6 @@ void ChromeActiveDocument::UpdateNavigationState( ScopedComPtr<IDocObjectService> doc_object_svc; ScopedComPtr<IWebBrowserEventsService> web_browser_events_svc; - buggy_bho::BuggyBhoTls bad_bho_tls; - if (GetConfigBool(true, kEnableBuggyBhoIntercept)) { - ScopedComPtr<IWebBrowser2> wb2; - DoQueryService(SID_SWebBrowserApp, m_spClientSite, wb2.Receive()); - if (wb2) { - buggy_bho::BuggyBhoTls::PatchBuggyBHOs(wb2); - } - } - DoQueryService(__uuidof(web_browser_events_svc), m_spClientSite, web_browser_events_svc.Receive()); |