diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 00:21:50 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 00:21:50 +0000 |
commit | b55aaa67d96309c6dd983d8cf8cfaad723174567 (patch) | |
tree | d287c31b6659954ee9e3b3820737fc331e9219d0 /chrome_frame/http_negotiate.h | |
parent | da1620f743c03a11705e8aa21cabcdac93523056 (diff) | |
download | chromium_src-b55aaa67d96309c6dd983d8cf8cfaad723174567.zip chromium_src-b55aaa67d96309c6dd983d8cf8cfaad723174567.tar.gz chromium_src-b55aaa67d96309c6dd983d8cf8cfaad723174567.tar.bz2 |
Adding support for Chrome Frame to be loaded via the presence of an X-UA-Compatible HTTP header (in addition to the meta tag support).
Also pins the CF module into the process such that it won't get unloaded. Doing this to work around how we can get unloaded without unpatching properly.
BUG=22802
TEST=Navigate to a web site whose server sends the X-UA-Compatible: chrome=1 HTTP header and ensure that the page is loaded in CF.
Review URL: http://codereview.chromium.org/465009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/http_negotiate.h')
-rw-r--r-- | chrome_frame/http_negotiate.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/chrome_frame/http_negotiate.h b/chrome_frame/http_negotiate.h index 4a22d9c..3146539 100644 --- a/chrome_frame/http_negotiate.h +++ b/chrome_frame/http_negotiate.h @@ -17,8 +17,24 @@ typedef HRESULT (STDMETHODCALLTYPE* IHttpNegotiate_OnResponse_Fn)( IHttpNegotiate* me, DWORD response_code, LPCWSTR response_header, LPCWSTR request_header, LPWSTR* additional_request_headers); +// Typedefs for IBindStatusCallback methods. +typedef HRESULT (STDMETHODCALLTYPE* IBindStatusCallback_StartBinding_Fn)( + IBindStatusCallback* me, DWORD reserved, IBinding *binding); + +// Typedefs for IInternetProtocolSink methods. +typedef HRESULT (STDMETHODCALLTYPE* IInternetProtocolSink_ReportProgress_Fn)( + IInternetProtocolSink* me, ULONG status_code, LPCWSTR status_text); + // Patches methods of urlmon's IHttpNegotiate implementation for the purposes // of adding to the http user agent header. + +// Also patches one of the IBindStatusCallback implementations in urlmon to pick +// up an IBinding during the StartBinding call. The IBinding implementor then +// gets a patch applied to its IInternetProtocolSink's ReportProgress method. +// The patched is there so that the reporting of the MIME type to the IBinding +// implementor can be changed if an X-Chrome-Frame HTTP header is present +// in the response headers. If anyone can suggest a more straightforward way of +// doing this, I would be eternally grateful. class HttpNegotiatePatch { // class is not to be instantiated atm. HttpNegotiatePatch(); @@ -28,15 +44,24 @@ class HttpNegotiatePatch { static bool Initialize(); static void Uninitialize(); + // IHttpNegotiate patch methods static STDMETHODIMP BeginningTransaction( IHttpNegotiate_BeginningTransaction_Fn original, IHttpNegotiate* me, LPCWSTR url, LPCWSTR headers, DWORD reserved, LPWSTR* additional_headers); - static STDMETHODIMP OnResponse( IHttpNegotiate_OnResponse_Fn original, IHttpNegotiate* me, DWORD response_code, LPCWSTR response_header, LPCWSTR request_header, LPWSTR* additional_request_headers); + // IBindStatusCallback patch methods + static STDMETHODIMP StartBinding(IBindStatusCallback_StartBinding_Fn original, + IBindStatusCallback* me, DWORD reserved, IBinding *binding); + + // IInternetProtocolSink patch methods + static STDMETHODIMP ReportProgress( + IInternetProtocolSink_ReportProgress_Fn original, + IInternetProtocolSink* me, ULONG status_code, LPCWSTR status_text); + protected: static HRESULT PatchHttpNegotiate(IUnknown* to_patch); |