summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 20:34:37 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 20:34:37 +0000
commit9ed9fcf3adda80b64a30fd9b8a43a102c9ca7928 (patch)
treeb0d74b2bfc0a3544b9e37e449a841caa07caaeeb /chrome_frame
parent883bdd89eea4cfbbd87342ba9212de8cccb6bdab (diff)
downloadchromium_src-9ed9fcf3adda80b64a30fd9b8a43a102c9ca7928.zip
chromium_src-9ed9fcf3adda80b64a30fd9b8a43a102c9ca7928.tar.gz
chromium_src-9ed9fcf3adda80b64a30fd9b8a43a102c9ca7928.tar.bz2
Attempting to fix the pure virtual function call crash in chrome frame test runs. It appears to be caused by a race
condition during disconnecting from chrome frame and receiving a callback from IE (Chrome Frame). Added checks to detect and work around this issue. Should fix http://code.google.com/p/chromium/issues/detail?id=41980 Bug=41980 Review URL: http://codereview.chromium.org/1703003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index 3aa7612..e8d3889 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -515,7 +515,7 @@ STDMETHODIMP WebBrowserEventSink::OnBeforeNavigate2Internal(
<< StringPrintf("%ls - 0x%08X", url->bstrVal, this);
// Reset any existing reference to chrome frame since this is a new
// navigation.
- chrome_frame_ = NULL;
+ DisconnectFromChromeFrame();
OnBeforeNavigate2(dispatch, url, flags, target_frame_name, post_data,
headers, cancel);
return S_OK;
@@ -572,18 +572,31 @@ STDMETHODIMP_(void) WebBrowserEventSink::OnNewWindow3Internal(
HRESULT WebBrowserEventSink::OnLoadInternal(const VARIANT* param) {
DLOG(INFO) << __FUNCTION__ << " " << param->bstrVal;
- OnLoad(param->bstrVal);
+ if (chrome_frame_) {
+ OnLoad(param->bstrVal);
+ } else {
+ DLOG(WARNING) << "Invalid chrome frame pointer";
+ }
return S_OK;
}
HRESULT WebBrowserEventSink::OnLoadErrorInternal(const VARIANT* param) {
DLOG(INFO) << __FUNCTION__ << " " << param->bstrVal;
- OnLoadError(param->bstrVal);
+ if (chrome_frame_) {
+ OnLoadError(param->bstrVal);
+ } else {
+ DLOG(WARNING) << "Invalid chrome frame pointer";
+ }
return S_OK;
}
HRESULT WebBrowserEventSink::OnMessageInternal(const VARIANT* param) {
DLOG(INFO) << __FUNCTION__ << " " << param;
+ if (!chrome_frame_.get()) {
+ DLOG(WARNING) << "Invalid chrome frame pointer";
+ return S_OK;
+ }
+
ScopedVariant data, origin, source;
if (param && (V_VT(param) == VT_DISPATCH)) {
wchar_t* properties[] = { L"data", L"origin", L"source" };