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/utils.cc | |
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/utils.cc')
-rw-r--r-- | chrome_frame/utils.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 61bf7df..10bf92a 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include <shlobj.h> +#include <wininet.h> #include "chrome_frame/html_utils.h" #include "chrome_frame/utils.h" @@ -610,3 +611,27 @@ bool IsValidUrlScheme(const std::wstring& url, bool is_privileged) { return false; } + +std::string GetRawHttpHeaders(IWinInetHttpInfo* info) { + DCHECK(info); + + std::string buffer; + + DWORD size = 0; + DWORD flags = 0; + DWORD reserved = 0; + HRESULT hr = info->QueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF, NULL, &size, + &flags, &reserved); + if (!size) { + DLOG(WARNING) << "Failed to query HTTP headers size. Error: " << hr; + } else { + buffer.resize(size + 1); + hr = info->QueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF, &buffer[0], + &size, &flags, &reserved); + if (FAILED(hr)) { + DLOG(WARNING) << "Failed to query HTTP headers. Error: " << hr; + } + } + + return buffer; +} |