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

Issue 2768813002: PlzNavigate: don't stop all loaders when renderer-initiated nav fails

Created:
3 years, 9 months ago by clamy
Modified:
3 years, 8 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, Randy Smith (Not in Mondays), blink-reviews, dglazkov+blink, darin-cc_chromium.org, loading-reviews_chromium.org, kinuko+watch, blink-reviews-api_chromium.org, mmenke
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

PlzNavigate: don't stop all loaders when renderer-initiated nav fails When a renderer-initiated navigation is aborted by the browser process in PlzNavigate, we currently send a FrameMsg_Stop IPC to the renderer process, in order for the renderer process to know that there is no longer a pending navigation being processed by the browser. This is wrong, as it also cancels any ongoing load in the current page. Instead, this CL introduces a new IPC that will only cancel the dummy provisional DocumentLoader that was created when the navigation was sent to the browser. BUG=576261 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebase #

Patch Set 3 : Removed id #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -4 lines) Patch
M content/browser/frame_host/frame_tree_node.cc View 1 2 2 chunks +9 lines, -3 lines 4 comments Download
M content/browser/frame_host/navigator_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/common/frame_messages.h View 1 2 1 chunk +5 lines, -0 lines 1 comment Download
M content/renderer/render_frame_impl.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 2 chunks +6 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/loader/FrameLoader.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebLocalFrame.h View 1 chunk +5 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 21 (11 generated)
clamy
@nasko, creis, japhet: PTAL. This is a spin-off from https://codereview.chromium.org/2735183003/. Regardless of whether we do ...
3 years, 9 months ago (2017-03-22 14:56:44 UTC) #5
Nate Chapin
blink LGTM
3 years, 9 months ago (2017-03-22 18:44:46 UTC) #8
dcheng
https://codereview.chromium.org/2768813002/diff/1/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp File third_party/WebKit/Source/web/WebLocalFrameImpl.cpp (right): https://codereview.chromium.org/2768813002/diff/1/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp#newcode2168 third_party/WebKit/Source/web/WebLocalFrameImpl.cpp:2168: if (frame()) Nit: is it possible to DCHECK() this? ...
3 years, 9 months ago (2017-03-22 19:00:50 UTC) #10
Charlie Reis
I'm starting to concede that you might be right about the need for an ID, ...
3 years, 9 months ago (2017-03-23 00:09:07 UTC) #11
clamy
On 2017/03/23 00:09:07, Charlie Reis (OOO soon) wrote: > I'm starting to concede that you ...
3 years, 9 months ago (2017-03-23 16:02:51 UTC) #14
Charlie Reis
Thanks! Looking better. On 2017/03/23 16:02:51, clamy (ooo until Apr 3) wrote: > On 2017/03/23 ...
3 years, 9 months ago (2017-03-23 16:52:53 UTC) #17
nasko
Is there next step for this CL? Or is it going to be closed?
3 years, 8 months ago (2017-04-19 18:12:18 UTC) #18
clamy
I thought I had answered comments but hadn't. I'll try to work on another iteration ...
3 years, 8 months ago (2017-04-24 13:53:44 UTC) #19
Charlie Reis
https://codereview.chromium.org/2768813002/diff/40001/content/browser/frame_host/frame_tree_node.cc File content/browser/frame_host/frame_tree_node.cc (right): https://codereview.chromium.org/2768813002/diff/40001/content/browser/frame_host/frame_tree_node.cc#newcode408 content/browser/frame_host/frame_tree_node.cc:408: inform_renderer && !navigation_request_->may_transfer(); On 2017/04/24 13:53:44, clamy wrote: > ...
3 years, 8 months ago (2017-04-24 20:13:38 UTC) #20
clamy
3 years, 8 months ago (2017-04-25 12:24:09 UTC) #21
https://codereview.chromium.org/2768813002/diff/40001/content/browser/frame_h...
File content/browser/frame_host/frame_tree_node.cc (right):

https://codereview.chromium.org/2768813002/diff/40001/content/browser/frame_h...
content/browser/frame_host/frame_tree_node.cc:408: inform_renderer &&
!navigation_request_->may_transfer();
On 2017/04/24 20:13:38, Charlie Reis wrote:
> On 2017/04/24 13:53:44, clamy wrote:
> > On 2017/03/23 16:52:53, Charlie Reis wrote:
> > > Hmm, I'm not sure I understand this change.  Why was !browser_initiated()
> > wrong?
> > >  It was more clearly about the case that the renderer would have some
state
> > that
> > > needs clearing.  Using may_transfer() instead is subtle and indirect--
> without
> > > looking into the code, I don't know why it's equivalent.  (That also means
> > it's
> > > at risk of changing for unrelated reasons, which could break this check.)
> > 
> > We should only inform the renderer if the navigation was started through the
> > BeginNavigation path because that;s the only case where it is expecting the
> > browser process to be doing a navigation (which corresponds to
> > !navigation_request_->may_transfer()). browser_initiated may be false for
> > navigations started via RequestNavigation, if they ultimately come from
> OpenURL.
> 
> Ok, so the OpenURL case means the renderer doesn't need to be notified, and
thus
> !browser_initiated() isn't the right thing to use.  (I guess the renderer
> doesn't go into a loading state in that case?)
> 
> But how is "may_transfer" connected to BeginNavigation?  A renderer-initiated
> navigation via BeginNavigation seems like it could still transfer (e.g., for a
> redirect to the Chrome Web Store).  Maybe I'm just having trouble with the
> name-- the comment on NavigationRequest::may_transfer_ is similarly confusing
to
> me, since it says that a transfer may happen even when may_transfer_ is false.

> Maybe we can rename that to be clearer, to help this case make sense as well.
> 
> Is may_transfer() actually about whether we send the navigation through
> RenderFrameHostManager to do a process swap for cross-site navigations (and
thus
> preserve the current process model in PlzNavigate)?
> 
> If so, there's two ways we might try to address this:
> 
> 1) Make the name (and comment) closer to that case, with something like
> should_swap_if_cross_site().  That reduces some of the ambiguity around the
word
> "transfer," since we do transfers already in non-PlzNavigate on
> renderer-initiated navigations (like the CWS case).  However, even this name
is
> a bit odd in the current context, since "whether the renderer has navigation
> state" and "whether we should swap processes for cross-site navigations" are
two
> different concepts that just happen to be the same at the moment.
> 
> 2) Make this member of NavigationRequest explicitly be about whether it
started
> with a BeginNavigation (e.g., from_begin_navigation()?).  Then we can build
> policies on top of that state, including whether to do a process swap for
> cross-site navigations and whether the renderer needs to be notified when a
> navigation is reset.
> 
> I'm leaning towards the latter.  What do you think?

I agree that the naming is confusing. I think we named in that way because it
was only used in one particular place for which the naming made more sense (and
I wanted to keep it short).

Since we're using it in other contexts than RenderFrameHostmanager, I like
option 2 better as well.

Powered by Google App Engine
This is Rietveld 408576698