summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_active_document.cc
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 22:06:14 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 22:06:14 +0000
commit051236f654c97138dd90a81c84e2b4dcaeb29918 (patch)
treeba065c97767f081d19f804d3a196b3ebba5d0609 /chrome_frame/chrome_active_document.cc
parent507c71074588f718be1808bc0ffe51f3733f6eb7 (diff)
downloadchromium_src-051236f654c97138dd90a81c84e2b4dcaeb29918.zip
chromium_src-051236f654c97138dd90a81c84e2b4dcaeb29918.tar.gz
chromium_src-051236f654c97138dd90a81c84e2b4dcaeb29918.tar.bz2
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
Diffstat (limited to 'chrome_frame/chrome_active_document.cc')
-rw-r--r--chrome_frame/chrome_active_document.cc38
1 files changed, 29 insertions, 9 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index e4a26bd..08efdd2 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -209,16 +209,30 @@ STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable,
SetClientSite(client_site);
DoQueryService(IID_INewWindowManager, client_site,
popup_manager_.Receive());
+
+ // See if mshtml parsed the html header for us. If so, we need to
+ // clear the browser service flag that we use to indicate that this
+ // browser instance is navigating to a CF document.
+ ScopedComPtr<IBrowserService> browser_service;
+ DoQueryService(SID_SShellBrowser, client_site, browser_service.Receive());
+ if (browser_service) {
+ bool flagged = CheckForCFNavigation(browser_service, true);
+ DLOG_IF(INFO, flagged) << "Cleared flagged browser service";
+ }
}
- Bho* chrome_frame_bho = Bho::GetCurrentThreadBhoInstance();
+ NavigationManager* mgr = NavigationManager::GetThreadInstance();
+ DCHECK(mgr);
// If the original URL contains an anchor, then the URL queried
// from the moniker does not contain the anchor. To workaround
// this we retrieve the URL from our BHO.
- std::wstring url = GetActualUrlFromMoniker(
- moniker_name, bind_context,
- chrome_frame_bho ? chrome_frame_bho->url() : std::wstring());
+ std::wstring url(GetActualUrlFromMoniker(moniker_name, bind_context,
+ mgr ? mgr->url() : std::wstring()));
+
+ scoped_refptr<RequestData> data(mgr->GetActiveRequestData(url.c_str()));
+ DLOG_IF(INFO, data) << "Got active request data";
+ DLOG_IF(WARNING, data.get() == NULL) << "NO active request data";
// The is_new_navigation variable indicates if this a navigation initiated
// by typing in a URL for e.g. in the IE address bar, or from Chrome by
@@ -237,8 +251,8 @@ STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable,
return E_INVALIDARG;
}
- if (!is_chrome_protocol) {
- url_fetcher_.UseMonikerForUrl(moniker_name, bind_context, url);
+ if (!is_chrome_protocol && data) {
+ url_fetcher_.UseRequestDataForUrl(data, url);
}
THREAD_SAFE_UMA_HISTOGRAM_CUSTOM_COUNTS("ChromeFrame.FullTabLaunchType",
@@ -595,6 +609,12 @@ void ChromeActiveDocument::UpdateNavigationState(
if (new_navigation_info.url.is_valid()) {
url_.Allocate(UTF8ToWide(new_navigation_info.url.spec()).c_str());
+ NavigationManager* mgr = NavigationManager::GetThreadInstance();
+ DCHECK(mgr);
+ if (mgr) {
+ mgr->set_url(url_);
+ mgr->ReleaseRequestData();
+ }
}
if (is_internal_navigation) {
@@ -910,9 +930,9 @@ bool ChromeActiveDocument::LaunchUrl(const std::wstring& url,
WideToUTF8(url_, url_.Length(), &utf8_url);
std::string referrer;
- Bho* chrome_frame_bho = Bho::GetCurrentThreadBhoInstance();
- if (chrome_frame_bho)
- referrer = chrome_frame_bho->referrer();
+ NavigationManager* mgr = NavigationManager::GetThreadInstance();
+ if (mgr)
+ referrer = mgr->referrer();
if (!automation_client_->InitiateNavigation(utf8_url,
referrer,