Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Issue 115575: Move ExtraData from WebRequest to WebDataSource.... (Closed)

Created:
11 years, 7 months ago by darin (slow to review)
Modified:
9 years, 7 months ago
Reviewers:
brettw
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=16580

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 9

Patch Set 3 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+167 lines, -167 lines) Patch
M chrome/renderer/render_view.h View 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 20 chunks +82 lines, -67 lines 2 comments Download
M webkit/api/public/WebDataSource.h View 3 chunks +4 lines, -4 lines 0 comments Download
M webkit/glue/webdatasource.h View 1 2 2 chunks +14 lines, -0 lines 0 comments Download
M webkit/glue/webdatasource_impl.h View 2 chunks +4 lines, -7 lines 0 comments Download
M webkit/glue/webdatasource_impl.cc View 2 chunks +8 lines, -5 lines 0 comments Download
M webkit/glue/webframe_impl.h View 1 chunk +0 lines, -4 lines 0 comments Download
M webkit/glue/webframe_impl.cc View 2 chunks +0 lines, -21 lines 0 comments Download
M webkit/glue/webframeloaderclient_impl.cc View 2 chunks +3 lines, -7 lines 0 comments Download
M webkit/glue/weburlrequest.h View 1 chunk +0 lines, -23 lines 0 comments Download
M webkit/glue/weburlrequest_impl.h View 2 chunks +0 lines, -3 lines 0 comments Download
M webkit/glue/weburlrequest_impl.cc View 1 chunk +0 lines, -8 lines 0 comments Download
M webkit/glue/webview_delegate.h View 1 chunk +5 lines, -0 lines 0 comments Download
M webkit/tools/test_shell/test_navigation_controller.h View 1 chunk +4 lines, -5 lines 0 comments Download
M webkit/tools/test_shell/test_shell.cc View 2 chunks +11 lines, -2 lines 0 comments Download
M webkit/tools/test_shell/test_webview_delegate.h View 5 chunks +10 lines, -0 lines 0 comments Download
M webkit/tools/test_shell/test_webview_delegate.cc View 1 4 chunks +14 lines, -11 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
darin (slow to review)
11 years, 7 months ago (2009-05-20 17:08:24 UTC) #1
brettw
http://codereview.chromium.org/115575/diff/43/1022 File chrome/renderer/render_view.cc (right): http://codereview.chromium.org/115575/diff/43/1022#newcode812 Line 812: if (!params.url.SchemeIs("javascript")) { chrome::kJavascriptScheme instead of hard-coding? http://codereview.chromium.org/115575/diff/43/1022#newcode1033 ...
11 years, 7 months ago (2009-05-20 22:23:06 UTC) #2
brettw
LGTM, good luck! http://codereview.chromium.org/115575/diff/50/67 File chrome/renderer/render_view.cc (right): http://codereview.chromium.org/115575/diff/50/67#newcode1033 Line 1033: if (!frame->GetParent()) { This is ...
11 years, 7 months ago (2009-05-20 23:41:04 UTC) #3
darin (slow to review)
11 years, 7 months ago (2009-05-21 00:06:02 UTC) #4
http://codereview.chromium.org/115575/diff/43/1022
File chrome/renderer/render_view.cc (right):

http://codereview.chromium.org/115575/diff/43/1022#newcode1033
Line 1033: if (!frame->GetParent()) {
I made this change to be consistent with "is top most frame" checks elsewhere in
this file.

If it did not have a parent, then it would not have a WebView, and there would
be no WebViewDelegate.  I think it is also not possible to navigate an IFRAME
that is detached from the DOM.

http://codereview.chromium.org/115575/diff/43/1022#newcode1458
Line 1458:
frame->GetDataSource()->SetExtraData(pending_navigation_state_.release());
pending_navigation_state_ will be null when the browser did not initiate the
navigation.  in that case, we want to clear the extradata so that we don't
interpret pre-existing extradata.  i'll add a comment to that effect.

http://codereview.chromium.org/115575/diff/43/1012
File webkit/glue/webdatasource.h (right):

http://codereview.chromium.org/115575/diff/43/1012#newcode35
Line 35: class ExtraData {
argh... too much webkit coding for me lately :(

http://codereview.chromium.org/115575/diff/50/67
File chrome/renderer/render_view.cc (right):

http://codereview.chromium.org/115575/diff/50/67#newcode1033
Line 1033: if (!frame->GetParent()) {
Yeah... cross your fingers for me!

Powered by Google App Engine
This is Rietveld 408576698