5 years, 6 months ago
(2015-06-08 18:32:43 UTC)
#4
clamy@, fdegans@: PTAL.
This fixes:
SecurityExploitBrowserTest.AttemptDuplicateRenderViewHost
SecurityExploitBrowserTest.AttemptDuplicateRenderWidgetHost
https://codereview.chromium.org/1163303003/diff/40001/content/browser/securit...
File content/browser/security_exploit_browsertest.cc (right):
https://codereview.chromium.org/1163303003/diff/40001/content/browser/securit...
content/browser/security_exploit_browsertest.cc:86: pending_rvh =
wc->GetRenderManagerForTesting()->pending_render_view_host();
I didn't create an equivalent RFHM::speculative_render_view_host method there's
a TODO in this one stating it should be removed in the future.
clamy
Thanks! I think this patch can be made simpler by having the call to the ...
5 years, 6 months ago
(2015-06-09 10:02:01 UTC)
#5
Thanks! I think this patch can be made simpler by having the call to the RFHM
either:
1 - inside FrameTreeNode::SetNavigationRequest.
2 - inside the constructor of the NavigationRequest.
This two points in code correspond to a new navigation (browser-initiated or
render-initiated), which makes the reasoning simpler since there will only be a
single call to RFHM. Then RFHM::BeginNavigation should also be renamed
RFHM::DidCreateNavigationRequest to match what it now corresponds to.
https://codereview.chromium.org/1163303003/diff/40001/content/browser/frame_h...
File content/browser/frame_host/navigator_impl.cc (right):
https://codereview.chromium.org/1163303003/diff/40001/content/browser/frame_h...
content/browser/frame_host/navigator_impl.cc:822: if
(NavigationRequest::ShouldMakeNetworkRequest(
I find the new ordering of comments not clearer. I think having the paragraph
summary was simpler. This will be even more the case if you move the call to
RFHM inside FrameTreeNode.
carlosk
On 2015/06/09 10:02:01, clamy wrote: > Thanks! I think this patch can be made simpler ...
5 years, 6 months ago
(2015-06-09 15:33:51 UTC)
#6
On 2015/06/09 10:02:01, clamy wrote:
> Thanks! I think this patch can be made simpler by having the call to the RFHM
> either:
> 1 - inside FrameTreeNode::SetNavigationRequest.
> 2 - inside the constructor of the NavigationRequest.
>
> This two points in code correspond to a new navigation (browser-initiated or
> render-initiated), which makes the reasoning simpler since there will only be
a
> single call to RFHM. Then RFHM::BeginNavigation should also be renamed
> RFHM::DidCreateNavigationRequest to match what it now corresponds to.
Thanks.
I chose option 1 and moved RFHM::BeginNavigation into FTN::SetNavigationRequest.
Finally it was not needed to guard that call with
NavigationRequest::ShouldMakeNetworkRequest as it used to be the case.
On the other hand as this change changes the order of things -- now first the
next RFH is dealt with and only after the beforeunload dispatch happens -- the
check for the current RFH being live is effected. So the preconditions for
sending the beforeunload IPC were extracted into a new method that is called
before FTN::SetNavigationRequest to be used later.
https://chromiumcodereview.appspot.com/1163303003/diff/40001/content/browser/...
File content/browser/frame_host/navigator_impl.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/40001/content/browser/...
content/browser/frame_host/navigator_impl.cc:822: if
(NavigationRequest::ShouldMakeNetworkRequest(
On 2015/06/09 10:02:01, clamy wrote:
> I find the new ordering of comments not clearer. I think having the paragraph
> summary was simpler. This will be even more the case if you move the call to
> RFHM inside FrameTreeNode.
Reverted to the previous comment with slight adaptations.
clamy
Thanks! It looks better now. A few comments. https://codereview.chromium.org/1163303003/diff/60001/content/browser/frame_host/frame_tree_node.cc File content/browser/frame_host/frame_tree_node.cc (right): https://codereview.chromium.org/1163303003/diff/60001/content/browser/frame_host/frame_tree_node.cc#newcode223 content/browser/frame_host/frame_tree_node.cc:223: render_manager()->BeginNavigation(*navigation_request_); ...
5 years, 6 months ago
(2015-06-09 16:01:30 UTC)
#7
One additional comment I just thought about. https://codereview.chromium.org/1163303003/diff/60001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/1163303003/diff/60001/content/browser/frame_host/render_frame_host_impl.cc#newcode1687 content/browser/frame_host/render_frame_host_impl.cc:1687: if (base::CommandLine::ForCurrentProcess()->HasSwitch( ...
5 years, 6 months ago
(2015-06-09 16:07:44 UTC)
#8
Thanks! A few more comments. https://codereview.chromium.org/1163303003/diff/100001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/1163303003/diff/100001/content/browser/frame_host/navigator_impl.cc#newcode821 content/browser/frame_host/navigator_impl.cc:821: // NavigationRequest::BeginNavigation should get ...
5 years, 6 months ago
(2015-06-10 12:30:28 UTC)
#10
Thanks again. https://chromiumcodereview.appspot.com/1163303003/diff/100001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://chromiumcodereview.appspot.com/1163303003/diff/100001/content/browser/frame_host/navigator_impl.cc#newcode821 content/browser/frame_host/navigator_impl.cc:821: // NavigationRequest::BeginNavigation should get called. If the ...
5 years, 6 months ago
(2015-06-10 13:15:06 UTC)
#11
Thanks! Lgtm with one nit. https://codereview.chromium.org/1163303003/diff/120001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/1163303003/diff/120001/content/browser/frame_host/navigator_impl.cc#newcode809 content/browser/frame_host/navigator_impl.cc:809: // This value must ...
5 years, 6 months ago
(2015-06-10 13:22:03 UTC)
#12
Thanks. nasko@: PTAL. https://chromiumcodereview.appspot.com/1163303003/diff/120001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://chromiumcodereview.appspot.com/1163303003/diff/120001/content/browser/frame_host/navigator_impl.cc#newcode809 content/browser/frame_host/navigator_impl.cc:809: // This value must be set ...
5 years, 6 months ago
(2015-06-10 14:22:53 UTC)
#14
Looks mostly good, just a few minor things. https://codereview.chromium.org/1163303003/diff/140001/content/browser/frame_host/navigator_impl.cc File content/browser/frame_host/navigator_impl.cc (right): https://codereview.chromium.org/1163303003/diff/140001/content/browser/frame_host/navigator_impl.cc#newcode643 content/browser/frame_host/navigator_impl.cc:643: frame_tree_node->SetNavigationRequest(navigation_request.Pass()); ...
5 years, 6 months ago
(2015-06-12 17:22:22 UTC)
#15
5 years, 6 months ago
(2015-06-15 19:11:55 UTC)
#16
Thanks.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
File content/browser/frame_host/navigator_impl.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/navigator_impl.cc:643:
frame_tree_node->SetNavigationRequest(navigation_request.Pass());
On 2015/06/12 17:22:22, nasko (slow) wrote:
> If you've eliminated the local scoped_ptr in RequestNavigation and this method
> is already being modified, might as well standardize on one pattern and use
it.
Done.
My initial thought was that as it is used it only once here (there it was used
many times) I'd keep the diff simpler by not making this change. Still trying to
find the correct balance.
I was tempted to merge the now raw navigation_request pointer with the
ongoing_navigation_request above but felt like this split make things clearer.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/navigator_impl.cc:822: // the case if the renderer is
not live, this is a subframe navigation, or if
On 2015/06/12 17:22:22, nasko (slow) wrote:
> The details of when running the beforeUnload handler is required or not
> shouldn't be documented here, but rather at ShouldDispatchBeforeUnload.
I'm assuming the same logic applies to the details concerning
ShouldMakeNetworkRequest.
So I updated this comment to not go into either of them and moved information
out to the declaration of ShouldMakeNetworkRequest (ShouldDispatchBeforeUnload
already had the concerned details).
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
File content/browser/frame_host/navigator_impl_unittest.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/navigator_impl_unittest.cc:883:
EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
On 2015/06/12 17:22:22, nasko (slow) wrote:
> You have an EXPECT_EQ in other places with this pattern, why not here?
Done.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
File content/browser/frame_host/render_frame_host_impl.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/render_frame_host_impl.cc:1682: // There's no live
renderer or this is a subframe, so just skip running
On 2015/06/12 17:22:22, nasko (slow) wrote:
> ShouldDispatchBeforeUnload should be clear enough without need to comment on
the
> decision behind it. It invites stale comments if the implementation changes.
Done.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/render_frame_host_impl.cc:1683: // BeforeUnload.
On 2015/06/12 17:22:22, nasko (slow) wrote:
> nit: Keep the capitalization intact (aka no capitalization).
Done.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/render_frame_host_impl.cc:1686: !for_navigation);
On 2015/06/12 17:22:22, nasko (slow) wrote:
> !A || !B is the same as !(A && B), but is a bit more readable.
Done.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
File content/browser/frame_host/render_frame_host_manager.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/render_frame_host_manager.cc:704: void
RenderFrameHostManager::DidSetNavigationRequest(
On 2015/06/12 17:22:22, nasko (slow) wrote:
> nit: I don't have a great alternative for the name, but the "Set" part of it
> seems a bit strange. Maybe DidCreateNavigationRequest, such that the logic
> becomes "When a new nav request is created, we should create a speculative
RFH".
I renamed the method to DidCreateNavigationRequest (it was one of the
suggestions by clamy@ as well).
But now should I also move the call to it from
FrameTreeNode::SetNavigationRequest to NavigationRequest's constructor given
the new name? Even though it seems more consistent I feel it a bit odd to have a
notification triggered just by instantiating the request.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
File content/browser/frame_host/render_frame_host_manager.h (right):
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/render_frame_host_manager.h:388: // set in the frame
node so that it can speculatively create a new
On 2015/06/12 17:22:22, nasko (slow) wrote:
> nit: Let's use actual class names, so it is more concrete. s/frame
> node/FrameTreeNode/.
Done.
nasko
LGTM with a couple of nits. https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc (right): https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser/frame_host/render_frame_host_manager.cc#newcode704 content/browser/frame_host/render_frame_host_manager.cc:704: void RenderFrameHostManager::DidSetNavigationRequest( On ...
5 years, 6 months ago
(2015-06-15 22:12:45 UTC)
#17
LGTM with a couple of nits.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
File content/browser/frame_host/render_frame_host_manager.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/render_frame_host_manager.cc:704: void
RenderFrameHostManager::DidSetNavigationRequest(
On 2015/06/15 19:11:54, carlosk wrote:
> On 2015/06/12 17:22:22, nasko (slow) wrote:
> > nit: I don't have a great alternative for the name, but the "Set" part of it
> > seems a bit strange. Maybe DidCreateNavigationRequest, such that the logic
> > becomes "When a new nav request is created, we should create a speculative
> RFH".
>
> I renamed the method to DidCreateNavigationRequest (it was one of the
> suggestions by clamy@ as well).
>
> But now should I also move the call to it from
> FrameTreeNode::SetNavigationRequest to NavigationRequest's constructor given
> the new name? Even though it seems more consistent I feel it a bit odd to have
a
> notification triggered just by instantiating the request.
I think moving the SetNavigationRequest call to the constructor makes sense.
Alternatively (or in addition), rename FT::SetNavigationRequest to
FT::CreatedNavigationRequest to be more clear on when to call this method.
https://chromiumcodereview.appspot.com/1163303003/diff/180001/content/browser...
File content/browser/frame_host/navigation_request.h (right):
https://chromiumcodereview.appspot.com/1163303003/diff/180001/content/browser...
content/browser/frame_host/navigation_request.h:57: // sent to the network
stack. It will not be sent for data URLs or Javascript
nit: JavaScript
https://chromiumcodereview.appspot.com/1163303003/diff/180001/content/browser...
File content/browser/frame_host/navigator_impl.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/180001/content/browser...
content/browser/frame_host/navigator_impl.cc:820: // Have the current renderer
execute its beforeUnload event if needed. If it
Let's fix the usage of 'beforeunload' on the first line to be inline with the
rest.
carlosk
Thanks again. See below for why I finally didn't move that call. https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc ...
5 years, 6 months ago
(2015-06-16 10:14:46 UTC)
#18
Thanks again.
See below for why I finally didn't move that call.
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
File content/browser/frame_host/render_frame_host_manager.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/140001/content/browser...
content/browser/frame_host/render_frame_host_manager.cc:704: void
RenderFrameHostManager::DidSetNavigationRequest(
On 2015/06/15 22:12:45, nasko (slow) wrote:
> On 2015/06/15 19:11:54, carlosk wrote:
> > On 2015/06/12 17:22:22, nasko (slow) wrote:
> > > nit: I don't have a great alternative for the name, but the "Set" part of
it
> > > seems a bit strange. Maybe DidCreateNavigationRequest, such that the logic
> > > becomes "When a new nav request is created, we should create a speculative
> > RFH".
> >
> > I renamed the method to DidCreateNavigationRequest (it was one of the
> > suggestions by clamy@ as well).
> >
> > But now should I also move the call to it from
> > FrameTreeNode::SetNavigationRequest to NavigationRequest's constructor
given
> > the new name? Even though it seems more consistent I feel it a bit odd to
have
> a
> > notification triggered just by instantiating the request.
>
> I think moving the SetNavigationRequest call to the constructor makes sense.
> Alternatively (or in addition), rename FT::SetNavigationRequest to
> FT::CreatedNavigationRequest to be more clear on when to call this method.
Moving the SetNavigationRequest call to the constructor makes so that it is
called *before* the request is set on the FrameTreeNode. This caused more tests
failures because there's a lot of things that can happen from when the call
happens, like the navigation committing or delegate notifications being invoked.
So I decided to keep it where it is but rename the method as you suggested
making the naming scheme more consistent.
https://chromiumcodereview.appspot.com/1163303003/diff/180001/content/browser...
File content/browser/frame_host/navigation_request.h (right):
https://chromiumcodereview.appspot.com/1163303003/diff/180001/content/browser...
content/browser/frame_host/navigation_request.h:57: // sent to the network
stack. It will not be sent for data URLs or Javascript
On 2015/06/15 22:12:45, nasko (slow) wrote:
> nit: JavaScript
Done.
https://chromiumcodereview.appspot.com/1163303003/diff/180001/content/browser...
File content/browser/frame_host/navigator_impl.cc (right):
https://chromiumcodereview.appspot.com/1163303003/diff/180001/content/browser...
content/browser/frame_host/navigator_impl.cc:820: // Have the current renderer
execute its beforeUnload event if needed. If it
On 2015/06/15 22:12:45, nasko (slow) wrote:
> Let's fix the usage of 'beforeunload' on the first line to be inline with the
> rest.
Done.
carlosk
The CQ bit was checked by carlosk@chromium.org
5 years, 6 months ago
(2015-06-16 10:14:56 UTC)
#19
Issue 1163303003: PlzNavigate: Create the speculative renderer earlier.
(Closed)
Created 5 years, 6 months ago by carlosk
Modified 5 years, 6 months ago
Reviewers: clamy, Fabrice (no longer in Chrome), nasko
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 53