summaryrefslogtreecommitdiffstats
path: root/chrome_frame/http_negotiate.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 22:19:54 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 22:19:54 +0000
commit9ddaa612154e9202970742f44446d3858bbf1309 (patch)
treea2239a26c9131173c43938b51311dd2360064322 /chrome_frame/http_negotiate.cc
parenteb8605cc05a24c5d444c43d3c559b44ce7a5a75e (diff)
downloadchromium_src-9ddaa612154e9202970742f44446d3858bbf1309.zip
chromium_src-9ddaa612154e9202970742f44446d3858bbf1309.tar.gz
chromium_src-9ddaa612154e9202970742f44446d3858bbf1309.tar.bz2
In ChromeFrame in the IInternetProtocolRoot::ReportProgress patch use the exception barrier version which only reports crashes
in ChromeFrame while calling the original function. We also use the other version of the ExceptionBarrier when we switch the mime type from text/html. This is to prevent the vectored exception handler from handling this exception and reporting a false positive if any stack based exception handler actually handles this exception. The other change is to remove the IHttpNegotiate::OnResponse patch as it did not do anything useful and some crashes were being reported while invoking the original function. Fixes bugs http://code.google.com/p/chromium/issues/detail?id=44767 and http://code.google.com/p/chromium/issues/detail?id=44765 Bug=44767,44765 Review URL: http://codereview.chromium.org/2078030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/http_negotiate.cc')
-rw-r--r--chrome_frame/http_negotiate.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/chrome_frame/http_negotiate.cc b/chrome_frame/http_negotiate.cc
index 37fcf2f..87dc65c5 100644
--- a/chrome_frame/http_negotiate.cc
+++ b/chrome_frame/http_negotiate.cc
@@ -13,6 +13,7 @@
#include "base/string_util.h"
#include "chrome_frame/bho.h"
+#include "chrome_frame/exception_barrier.h"
#include "chrome_frame/html_utils.h"
#include "chrome_frame/urlmon_url_request.h"
#include "chrome_frame/urlmon_moniker.h"
@@ -31,13 +32,10 @@ const char kUACompatibleHttpHeader[] = "x-ua-compatible";
const int LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE = 54;
static const int kHttpNegotiateBeginningTransactionIndex = 3;
-static const int kHttpNegotiateOnResponseTransactionIndex = 4;
BEGIN_VTABLE_PATCHES(IHttpNegotiate)
VTABLE_PATCH_ENTRY(kHttpNegotiateBeginningTransactionIndex,
HttpNegotiatePatch::BeginningTransaction)
- VTABLE_PATCH_ENTRY(kHttpNegotiateOnResponseTransactionIndex,
- HttpNegotiatePatch::OnResponse)
END_VTABLE_PATCHES()
static const int kBindStatusCallbackStartBindingIndex = 3;
@@ -287,17 +285,6 @@ HRESULT HttpNegotiatePatch::BeginningTransaction(
}
// static
-HRESULT HttpNegotiatePatch::OnResponse(IHttpNegotiate_OnResponse_Fn original,
- IHttpNegotiate* me, DWORD response_code, LPCWSTR response_header,
- LPCWSTR request_header, LPWSTR* additional_request_headers) {
- DLOG(INFO) << __FUNCTION__ << " headers: " << std::endl << response_header;
-
- HRESULT hr = original(me, response_code, response_header, request_header,
- additional_request_headers);
- return hr;
-}
-
-// static
HRESULT HttpNegotiatePatch::StartBinding(
IBindStatusCallback_StartBinding_Fn original,
IBindStatusCallback* me, DWORD reserved, IBinding* binding) {
@@ -334,6 +321,8 @@ HRESULT HttpNegotiatePatch::ReportProgress(
ULONG status_code, LPCWSTR status_text) {
DLOG(INFO) << __FUNCTION__
<< StringPrintf(" %i %ls", status_code, status_text);
+ bool updated_mime_type = false;
+
if (status_code == BINDSTATUS_MIMETYPEAVAILABLE ||
status_code == BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE ||
status_code == LOCAL_BINDSTATUS_SERVER_MIMETYPEAVAILABLE) {
@@ -396,11 +385,22 @@ HRESULT HttpNegotiatePatch::ReportProgress(
if (IsTextHtmlMimeType(status_text)) {
DLOG(INFO) << "- changing mime type to " << kChromeMimeType;
status_text = kChromeMimeType;
+ updated_mime_type = true;
} else {
DLOG(INFO) << "- don't want to render " << status_text << " in cf";
}
}
}
- return original(me, status_code, status_text);
+ if (updated_mime_type) {
+ // Report all crashes in the exception handler as we updated the mime type.
+ // Note that this avoids having the VEH report a crash if an SEH earlier in
+ // the chain handles the exception.
+ ExceptionBarrier barrier;
+ return original(me, status_code, status_text);
+ } else {
+ // Only report exceptions caused within ChromeFrame in this context.
+ ExceptionBarrierReportOnlyModule barrier;
+ return original(me, status_code, status_text);
+ }
}