| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome_frame/http_negotiate.h" | 5 #include "chrome_frame/http_negotiate.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlcom.h> | 8 #include <atlcom.h> |
| 9 #include <htiframe.h> | 9 #include <htiframe.h> |
| 10 | 10 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 if (http) { | 167 if (http) { |
| 168 hr = vtable_patch::PatchInterfaceMethods(http, IHttpNegotiate_PatchInfo); | 168 hr = vtable_patch::PatchInterfaceMethods(http, IHttpNegotiate_PatchInfo); |
| 169 DLOG_IF(ERROR, FAILED(hr)) | 169 DLOG_IF(ERROR, FAILED(hr)) |
| 170 << StringPrintf("HttpNegotiate patch failed 0x%08X", hr); | 170 << StringPrintf("HttpNegotiate patch failed 0x%08X", hr); |
| 171 } else { | 171 } else { |
| 172 DLOG(WARNING) | 172 DLOG(WARNING) |
| 173 << StringPrintf("IHttpNegotiate not supported 0x%08X", hr); | 173 << StringPrintf("IHttpNegotiate not supported 0x%08X", hr); |
| 174 } | 174 } |
| 175 | 175 |
| 176 ScopedComPtr<IBindStatusCallback> bscb; | 176 // CTransaction patch supports sniffing HTTP headers, so no need of |
| 177 hr = bscb.QueryFrom(to_patch); | 177 // sniffing inside HttpNegotiatePatch::ReportProgress. |
| 178 if (GetPatchMethod() != PATCH_METHOD_INET_PROTOCOL) { |
| 179 ScopedComPtr<IBindStatusCallback> bscb; |
| 180 hr = bscb.QueryFrom(to_patch); |
| 178 | 181 |
| 179 if (bscb) { | 182 if (bscb) { |
| 180 hr = vtable_patch::PatchInterfaceMethods(bscb, | 183 hr = vtable_patch::PatchInterfaceMethods(bscb, |
| 181 IBindStatusCallback_PatchInfo); | 184 IBindStatusCallback_PatchInfo); |
| 182 DLOG_IF(ERROR, FAILED(hr)) | 185 DLOG_IF(ERROR, FAILED(hr)) |
| 183 << StringPrintf("BindStatusCallback patch failed 0x%08X", hr); | 186 << StringPrintf("BindStatusCallback patch failed 0x%08X", hr); |
| 184 } else { | 187 } else { |
| 185 DLOG(WARNING) << StringPrintf("IBindStatusCallback not supported 0x%08X", | 188 DLOG(WARNING) << StringPrintf("IBindStatusCallback not supported 0x%08X", |
| 186 hr); | 189 hr); |
| 190 } |
| 187 } | 191 } |
| 188 return hr; | 192 return hr; |
| 189 } | 193 } |
| 190 | 194 |
| 191 // static | 195 // static |
| 192 HRESULT HttpNegotiatePatch::BeginningTransaction( | 196 HRESULT HttpNegotiatePatch::BeginningTransaction( |
| 193 IHttpNegotiate_BeginningTransaction_Fn original, IHttpNegotiate* me, | 197 IHttpNegotiate_BeginningTransaction_Fn original, IHttpNegotiate* me, |
| 194 LPCWSTR url, LPCWSTR headers, DWORD reserved, LPWSTR* additional_headers) { | 198 LPCWSTR url, LPCWSTR headers, DWORD reserved, LPWSTR* additional_headers) { |
| 195 DLOG(INFO) << __FUNCTION__ << " " << url << " headers:\n" << headers; | 199 DLOG(INFO) << __FUNCTION__ << " " << url << " headers:\n" << headers; |
| 196 | 200 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 // Note that this avoids having the VEH report a crash if an SEH earlier in | 401 // Note that this avoids having the VEH report a crash if an SEH earlier in |
| 398 // the chain handles the exception. | 402 // the chain handles the exception. |
| 399 ExceptionBarrier barrier; | 403 ExceptionBarrier barrier; |
| 400 return original(me, status_code, status_text); | 404 return original(me, status_code, status_text); |
| 401 } else { | 405 } else { |
| 402 // Only report exceptions caused within ChromeFrame in this context. | 406 // Only report exceptions caused within ChromeFrame in this context. |
| 403 ExceptionBarrierReportOnlyModule barrier; | 407 ExceptionBarrierReportOnlyModule barrier; |
| 404 return original(me, status_code, status_text); | 408 return original(me, status_code, status_text); |
| 405 } | 409 } |
| 406 } | 410 } |
| OLD | NEW |