diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 04:42:54 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 04:42:54 +0000 |
commit | 77f17a8a4b03e493392f04a77d97ea6e1379760d (patch) | |
tree | 43b549e31e17bd26849230d37a4a56b4ff631c5b /webkit/api/public/WebDataSource.h | |
parent | 852cb1e5ecef7e815963213013e94485654cf5cd (diff) | |
download | chromium_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/api/public/WebDataSource.h')
-rw-r--r-- | webkit/api/public/WebDataSource.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/webkit/api/public/WebDataSource.h b/webkit/api/public/WebDataSource.h index ef96042..b163221 100644 --- a/webkit/api/public/WebDataSource.h +++ b/webkit/api/public/WebDataSource.h @@ -1,10 +1,10 @@ /* * Copyright (C) 2009 Google Inc. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -14,7 +14,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -58,7 +58,7 @@ namespace WebKit { // to a location specified by a redirect that was followed. virtual const WebURLRequest& request() const = 0; - // Returns the response associated to this datasource. + // Returns the response associated with this datasource. virtual const WebURLResponse& response() const = 0; // When this datasource was created as a result of WebFrame::loadData, |