diff options
-rw-r--r-- | chrome_frame/urlmon_bind_status_callback.cc | 15 | ||||
-rw-r--r-- | chrome_frame/urlmon_moniker.cc | 10 |
2 files changed, 17 insertions, 8 deletions
diff --git a/chrome_frame/urlmon_bind_status_callback.cc b/chrome_frame/urlmon_bind_status_callback.cc index 8fb6ebd..b6d7c15 100644 --- a/chrome_frame/urlmon_bind_status_callback.cc +++ b/chrome_frame/urlmon_bind_status_callback.cc @@ -12,6 +12,7 @@ #include "base/utf_string_conversions.h" #include "chrome_frame/bind_context_info.h" +#include "chrome_frame/exception_barrier.h" #include "chrome_frame/urlmon_moniker.h" #include "chrome_tab.h" // NOLINT @@ -216,6 +217,10 @@ STDMETHODIMP BSCBStorageBind::OnProgress(ULONG progress, ULONG progress_max, ULONG status_code, LPCWSTR status_text) { DLOG(INFO) << __FUNCTION__ << me() << StringPrintf(" status=%i tid=%i %ls", status_code, PlatformThread::CurrentId(), status_text); + // Report all crashes in the exception handler if we wrap the callback. + // Note that this avoids having the VEH report a crash if an SEH earlier in + // the chain handles the exception. + ExceptionBarrier barrier; HRESULT hr = S_OK; @@ -247,7 +252,10 @@ STDMETHODIMP BSCBStorageBind::OnDataAvailable(DWORD flags, DWORD size, STGMEDIUM* stgmed) { DLOG(INFO) << __FUNCTION__ << StringPrintf(" tid=%i", PlatformThread::CurrentId()); - + // Report all crashes in the exception handler if we wrap the callback. + // Note that this avoids having the VEH report a crash if an SEH earlier in + // the chain handles the exception. + ExceptionBarrier barrier; // Do not touch anything other than text/html. bool is_interesting = (format_etc && stgmed && stgmed->pstm && stgmed->tymed == TYMED_ISTREAM && @@ -287,6 +295,11 @@ STDMETHODIMP BSCBStorageBind::OnDataAvailable(DWORD flags, DWORD size, STDMETHODIMP BSCBStorageBind::OnStopBinding(HRESULT hresult, LPCWSTR error) { DLOG(INFO) << __FUNCTION__ << StringPrintf(" tid=%i", PlatformThread::CurrentId()); + // Report all crashes in the exception handler if we wrap the callback. + // Note that this avoids having the VEH report a crash if an SEH earlier in + // the chain handles the exception. + ExceptionBarrier barrier; + HRESULT hr = MayPlayBack(BSCF_LASTDATANOTIFICATION); hr = CallbackImpl::OnStopBinding(hresult, error); ReleaseBind(); diff --git a/chrome_frame/urlmon_moniker.cc b/chrome_frame/urlmon_moniker.cc index cc9d6a8..6a3910b 100644 --- a/chrome_frame/urlmon_moniker.cc +++ b/chrome_frame/urlmon_moniker.cc @@ -209,6 +209,9 @@ HRESULT MonikerPatch::BindToStorage(IMoniker_BindToStorage_Fn original, IMoniker* to_left, REFIID iid, void** obj) { DCHECK(to_left == NULL); + // Report a crash if the crash is in our own module. + ExceptionBarrierReportOnlyModule barrier; + HRESULT hr = S_OK; CComObject<BSCBStorageBind>* callback = NULL; if (ShouldWrapCallback(me, iid, bind_ctx)) { @@ -216,15 +219,8 @@ HRESULT MonikerPatch::BindToStorage(IMoniker_BindToStorage_Fn original, callback->AddRef(); hr = callback->Initialize(me, bind_ctx); DCHECK(SUCCEEDED(hr)); - - // Report all crashes in the exception handler if we wrap the callback. - // Note that this avoids having the VEH report a crash if an SEH earlier in - // the chain handles the exception. - ExceptionBarrier barrier; hr = original(me, bind_ctx, to_left, iid, obj); } else { - // If we don't wrap, only report a crash if the crash is in our own module. - ExceptionBarrierReportOnlyModule barrier; hr = original(me, bind_ctx, to_left, iid, obj); } |