From 051236f654c97138dd90a81c84e2b4dcaeb29918 Mon Sep 17 00:00:00 2001 From: "tommi@chromium.org" Date: Fri, 12 Mar 2010 22:06:14 +0000 Subject: Fix #1 for multiple request issue (both POST and GET) after activating the onhttpequiv approach. There's a ton going on here. Brief summary: I'm introducing a caching layer for top level page requests that we then use again when switching the document from mshtml to cf. Also in this change list: * Removing the previous way of shifting the document moniker over to the worker thread when a new chrome document is created. Instead we use a request cache object. * Refactoring the part of the Bho class that offered access to it via TLS. This was needed for better testability but also makes (imho) the separation clearer and will possibly help in the future if we don't have a Bho object. * Added a bit of logging that I'd prefer to keep in there until we're confident enough with onhttpequiv. * Enabling two previously disabled tests (the ones I added for multiple requests) * Adding several more unit tests for the new code. Review URL: http://codereview.chromium.org/668187 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41495 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/utils.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'chrome_frame/utils.cc') diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 560d4dc..f58b47d 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -35,6 +35,8 @@ const wchar_t kXUACompatValue[] = L"x-ua-compatible"; const wchar_t kBodyTag[] = L"body"; const wchar_t kChromeContentPrefix[] = L"chrome="; const wchar_t kChromeProtocolPrefix[] = L"gcf:"; +const wchar_t kChromeMimeType[] = L"application/chromepage"; +const wchar_t kPatchProtocols[] = L"PatchProtocols"; static const wchar_t kChromeFrameConfigKey[] = L"Software\\Google\\ChromeFrame"; @@ -868,6 +870,17 @@ bool IsTopLevelWindow(HWND window) { return !parent || (parent == GetDesktopWindow()); } +HRESULT RewindStream(IStream* stream) { + HRESULT hr = E_POINTER; + if (stream) { + LARGE_INTEGER zero = {0}; + ULARGE_INTEGER new_pos = {0}; + hr = stream->Seek(zero, STREAM_SEEK_SET, &new_pos); + } + + return hr; +} + std::wstring GuidToString(const GUID& guid) { std::wstring ret; ::StringFromGUID2(guid, WriteInto(&ret, 39), 39); -- cgit v1.1