summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webdatasource_impl.h
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/webdatasource_impl.h
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/webdatasource_impl.h')
-rw-r--r--webkit/glue/webdatasource_impl.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/webkit/glue/webdatasource_impl.h b/webkit/glue/webdatasource_impl.h
index d4bef9c..912dffb 100644
--- a/webkit/glue/webdatasource_impl.h
+++ b/webkit/glue/webdatasource_impl.h
@@ -44,17 +44,12 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource {
virtual base::Time GetFinishLoadTime() const;
virtual base::Time GetFirstLayoutTime() const;
virtual WebNavigationType GetNavigationType() const;
+ virtual ExtraData* GetExtraData() const;
+ virtual void SetExtraData(ExtraData*);
static WebNavigationType NavigationTypeToWebNavigationType(
WebCore::NavigationType type);
- // Called after creating a new data source if there is request info
- // available. Since we store copies of the WebRequests, the original
- // WebRequest that the embedder created was lost, and the exra data would
- // go with it. This preserves the request info so retrieving the requests
- // later will have the same data.
- void SetExtraData(WebRequest::ExtraData* extra);
-
void ClearRedirectChain();
void AppendRedirect(const GURL& url);
@@ -127,6 +122,8 @@ class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource {
scoped_ptr<const SearchableFormData> searchable_form_data_;
scoped_ptr<const PasswordForm> password_form_data_;
+ OwnPtr<ExtraData> extra_data_;
+
bool form_submit_;
// See webdatasource.h for a description of these time stamps.