summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webframeloaderclient_impl.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 04:42:54 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 04:42:54 +0000
commit77f17a8a4b03e493392f04a77d97ea6e1379760d (patch)
tree43b549e31e17bd26849230d37a4a56b4ff631c5b /webkit/glue/webframeloaderclient_impl.cc
parent852cb1e5ecef7e815963213013e94485654cf5cd (diff)
downloadchromium_src-77f17a8a4b03e493392f04a77d97ea6e1379760d.zip
chromium_src-77f17a8a4b03e493392f04a77d97ea6e1379760d.tar.gz
chromium_src-77f17a8a4b03e493392f04a77d97ea6e1379760d.tar.bz2
Move ExtraData from WebRequest to WebDataSource.
This adds a DidCreateDataSource method to WebViewDelegate, which the embedder uses to know if their LoadRequest resulted in a navigation. The embedder then associates the ExtraData with the WebDataSource at that point. The WebDataSource then proceeds to be treated as the provisional data source, possibly failing or being committed. We then inspect WebFrame::GetDataSource in DidCommitLoadForFrame to recover the ExtraData. We have to take care to handle reference fragment navigations since those do not result in a new WebDataSource being created. So, in DidChangeLocationWithinPage, we update the ExtraData associated with the WebDataSource returned by WebFrame::GetDataSource. One thing that is important to note: In DidCommitLoadForFrame, we would previously always inspect the value of GetDataSource returned from the main frame instead of looking at the frame passed to DidCommitLoadForFrame. This explains why WebFrameImpl:: LoadRequest needed to cached ExtraData on the current WebDataSource, and I think doing so is awkward and wrong. My change is to always store the ExtraData on the first WebDataSource to be created as a result of LoadRequest. Then in DidCommitLoadForFrame, I always inspect the ExtraData from the given WebFrame. This means that for history navigations that only navigate a subframe, we'll end up with ExtraData associated with the WebDataSource of a subframe. I think this is OK even though the old code was trying to avoid this scenario. See the DCHECK removed in RenderView::UpdateURL. BUG=11423 R=brettw Review URL: http://codereview.chromium.org/115575 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webframeloaderclient_impl.cc')
-rw-r--r--webkit/glue/webframeloaderclient_impl.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc
index a1bed38..30aba5e 100644
--- a/webkit/glue/webframeloaderclient_impl.cc
+++ b/webkit/glue/webframeloaderclient_impl.cc
@@ -687,12 +687,6 @@ void WebFrameLoaderClient::dispatchDidChangeLocationWithinPage() {
// Regardless of how we got here, we are navigating to a URL so we need to
// add it to the redirect chain.
ds->AppendRedirect(url);
-
- // WebKit will re-use requests for in-page navigations, but we want to
- // think of it as a new request that has a page ID in session history.
- // This will set the proper page ID, etc. on the request so that the
- // browser will treat it properly.
- webframe_->CacheCurrentRequestInfo(ds);
}
bool is_new_navigation;
@@ -1347,7 +1341,9 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(
const ResourceRequest& request,
const SubstituteData& data) {
RefPtr<WebDataSourceImpl> ds = WebDataSourceImpl::Create(request, data);
- webframe_->CacheCurrentRequestInfo(ds.get());
+ WebViewDelegate* d = webframe_->GetWebViewImpl()->delegate();
+ if (d)
+ d->DidCreateDataSource(webframe_, ds.get());
return ds.release();
}