summaryrefslogtreecommitdiffstats
path: root/chrome_frame/urlmon_moniker.cc
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-20 17:55:44 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-20 17:55:44 +0000
commit4e4d0d61edfbdcab94d6c998ba2da60b41e2a5dd (patch)
tree43968134ce42d92fc8931ae5557fa387b38b029d /chrome_frame/urlmon_moniker.cc
parent9fa0cfa7cabbca959d6fc9fecd456c0e09d3cd08 (diff)
downloadchromium_src-4e4d0d61edfbdcab94d6c998ba2da60b41e2a5dd.zip
chromium_src-4e4d0d61edfbdcab94d6c998ba2da60b41e2a5dd.tar.gz
chromium_src-4e4d0d61edfbdcab94d6c998ba2da60b41e2a5dd.tar.bz2
Avoid wrapping callbacks for network requests not coming from MSHTML.
This is a tentative fix, since I was unable to reproduce crash in AcroPDF.dll Review URL: http://codereview.chromium.org/2087017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47813 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_moniker.cc')
-rw-r--r--chrome_frame/urlmon_moniker.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome_frame/urlmon_moniker.cc b/chrome_frame/urlmon_moniker.cc
index 3030128..cd55faa 100644
--- a/chrome_frame/urlmon_moniker.cc
+++ b/chrome_frame/urlmon_moniker.cc
@@ -146,6 +146,25 @@ bool ShouldWrapCallback(IMoniker* moniker, REFIID iid, IBindCtx* bind_context) {
return false;
}
+ // Check whether request comes from MSHTML by checking for IInternetBindInfo.
+ // We prefer to avoid wrapping if BindToStorage is called from AcroPDF.dll
+ // (as a result of OnObjectAvailable)
+ ScopedComPtr<IUnknown> bscb_holder;
+ if (S_OK == bind_context->GetObjectParam(L"_BSCB_Holder_",
+ bscb_holder.Receive())) {
+ ScopedComPtr<IBindStatusCallback> bscb;
+ if (S_OK != DoQueryService(IID_IBindStatusCallback, bscb_holder,
+ bscb.Receive()))
+ return false;
+
+ if (!bscb.get())
+ return false;
+
+ ScopedComPtr<IInternetBindInfo> bind_info;
+ if (S_OK != bind_info.QueryFrom(bscb))
+ return false;
+ }
+
// TODO(ananta)
// Use the IsSubFrameRequest function to determine if a request is a top
// level request. Something like this.