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

Issue 2594263004: Fix NavigationControllerBrowserTest.SubframeForwardRedirect (Closed)

Created:
3 years, 12 months ago by jam
Modified:
3 years, 11 months ago
Reviewers:
Charlie Reis, nasko
CC:
chromium-reviews, nasko+codewatch_chromium.org, darin-cc_chromium.org, creis+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix NavigationControllerBrowserTest.SubframeForwardRedirect with PlzNavigate and site isolation enabled. The problem is that NavigationRequest::dest_site_instance_ is set in the constructor of that class. If RenderFrameHostManager::CanSubframeSwapProcess determines that a cross process redirect should happen for the subframe (because of site isolation) then we might need to use a new site instance. BUG=674734 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2594263004 Cr-Commit-Position: refs/heads/master@{#442053} Committed: https://chromium.googlesource.com/chromium/src/+/015ba065ac2806f71b4c3b9e05b6d9013f473de1

Patch Set 1 : fix with plznav enabled #

Patch Set 2 : without plznav enabled #

Patch Set 3 : alternate fix with plznav enabled #

Patch Set 4 : without plznav enabled #

Patch Set 5 : relax dcheck #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -2 lines) Patch
M content/browser/frame_host/navigation_controller_impl.cc View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/frame_host/navigation_request.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 68 (53 generated)
jam
3 years, 12 months ago (2016-12-23 01:09:21 UTC) #31
nasko
Looks good, but adding Charlie for an extra pair of eyes. It should be PlzNavigate ...
3 years, 11 months ago (2017-01-04 18:39:52 UTC) #43
Charlie Reis
On 2017/01/04 18:39:52, nasko wrote: > Looks good, but adding Charlie for an extra pair ...
3 years, 11 months ago (2017-01-04 20:28:56 UTC) #44
jam
On 2017/01/04 20:28:56, Charlie Reis wrote: > On 2017/01/04 18:39:52, nasko wrote: > > Looks ...
3 years, 11 months ago (2017-01-04 23:46:54 UTC) #45
Charlie Reis
On 2017/01/04 23:46:54, jam wrote: > On 2017/01/04 20:28:56, Charlie Reis wrote: > > On ...
3 years, 11 months ago (2017-01-05 23:15:16 UTC) #46
jam
On 2017/01/05 23:15:16, Charlie Reis wrote: > On 2017/01/04 23:46:54, jam wrote: > > On ...
3 years, 11 months ago (2017-01-06 00:55:44 UTC) #51
Charlie Reis
On 2017/01/06 00:55:44, jam wrote: > On 2017/01/05 23:15:16, Charlie Reis wrote: > > On ...
3 years, 11 months ago (2017-01-06 01:06:32 UTC) #52
jam
On 2017/01/06 01:06:32, Charlie Reis wrote: > On 2017/01/06 00:55:44, jam wrote: > > On ...
3 years, 11 months ago (2017-01-06 18:58:47 UTC) #57
Charlie Reis
On 2017/01/06 18:58:47, jam wrote: > On 2017/01/06 01:06:32, Charlie Reis wrote: > > On ...
3 years, 11 months ago (2017-01-06 20:13:34 UTC) #58
Charlie Reis
On 2017/01/06 20:13:34, Charlie Reis wrote: > confirm unless this introduces a problem. s/confirm/approve/
3 years, 11 months ago (2017-01-06 20:14:10 UTC) #59
Charlie Reis
On 2017/01/06 20:13:34, Charlie Reis wrote: > On 2017/01/06 18:58:47, jam wrote: > > On ...
3 years, 11 months ago (2017-01-06 20:29:26 UTC) #60
jam
On 2017/01/06 20:29:26, Charlie Reis wrote: > On 2017/01/06 20:13:34, Charlie Reis wrote: > > ...
3 years, 11 months ago (2017-01-06 20:35:12 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2594263004/180001
3 years, 11 months ago (2017-01-06 20:35:46 UTC) #64
commit-bot: I haz the power
Committed patchset #5 (id:180001) as https://chromium.googlesource.com/chromium/src/+/015ba065ac2806f71b4c3b9e05b6d9013f473de1
3 years, 11 months ago (2017-01-06 21:17:37 UTC) #67
Charlie Reis
3 years, 11 months ago (2017-01-06 21:37:28 UTC) #68
Message was sent while issue was closed.
On 2017/01/06 20:35:12, jam wrote:
> On 2017/01/06 20:29:26, Charlie Reis wrote:
> > On 2017/01/06 20:13:34, Charlie Reis wrote:
> > > On 2017/01/06 18:58:47, jam wrote:
> > > > On 2017/01/06 01:06:32, Charlie Reis wrote:
> > > > > On 2017/01/06 00:55:44, jam wrote:
> > > > > > On 2017/01/05 23:15:16, Charlie Reis wrote:
> > > > > > > On 2017/01/04 23:46:54, jam wrote:
> > > > > > > > On 2017/01/04 20:28:56, Charlie Reis wrote:
> > > > > > > > > On 2017/01/04 18:39:52, nasko wrote:
> > > > > > > > > > Looks good, but adding Charlie for an extra pair of eyes. It
> > > should
> > > > be
> > > > > > > > > > PlzNavigate only change and not affect the current
navigation
> > > code.
> > > > > > > > > 
> > > > > > > > > I'm looking, but this is a bit complicated to reason about. 
> (I'm
> > > > trying
> > > > > > to
> > > > > > > > > understand if it's safe to replace the SiteInstance we created
> > > earlier
> > > > > > given
> > > > > > > > > that it has side effects, as well as why only some parameters
> are
> > > > passed
> > > > > > to
> > > > > > > > > GetSiteInstanceForNavigation the second time.) 
> > > > > > > > 
> > > > > > > > Thanks. The reason request.dest_site_instance() isn't passed in
is
> > > > because
> > > > > > > it'll
> > > > > > > > be used, although in the case that we need a new process we
don't
> > want
> > > > to
> > > > > > use
> > > > > > > > the existing process' siteinstance.
> > > > > > > > 
> > > > > > > > > I'm seeing if I can come up with
> > > > > > > > > a better recommendation.
> > > > > > > 
> > > > > > > On 2017/01/04 23:46:54, jam wrote:
> > > > > > > > On 2017/01/04 20:28:56, Charlie Reis wrote:
> > > > > > > > > On 2017/01/04 18:39:52, nasko wrote:
> > > > > > > > > > Looks good, but adding Charlie for an extra pair of eyes. It
> > > should
> > > > be
> > > > > > > > > > PlzNavigate only change and not affect the current
navigation
> > > code.
> > > > > > > > > 
> > > > > > > > > I'm looking, but this is a bit complicated to reason about. 
> (I'm
> > > > trying
> > > > > > to
> > > > > > > > > understand if it's safe to replace the SiteInstance we created
> > > earlier
> > > > > > given
> > > > > > > > > that it has side effects, as well as why only some parameters
> are
> > > > passed
> > > > > > to
> > > > > > > > > GetSiteInstanceForNavigation the second time.) 
> > > > > > > > 
> > > > > > > > Thanks. The reason request.dest_site_instance() isn't passed in
is
> > > > because
> > > > > > > it'll
> > > > > > > > be used, although in the case that we need a new process we
don't
> > want
> > > > to
> > > > > > use
> > > > > > > > the existing process' siteinstance.
> > > > > > > > 
> > > > > > > > > I'm seeing if I can come up with
> > > > > > > > > a better recommendation.
> > > > > > > 
> > > > > > > Ok, I've looked more closely and I think I have a simpler fix that
> > gets
> > > > the
> > > > > > test
> > > > > > > to pass and works in manual testing as well.
> > > > > > > 
> > > > > > > This test is setting up a case where a FrameNavigationEntry
> redirects
> > > > > > cross-site
> > > > > > > when we go back/forward to it.  Normally we do want to load a
> history
> > > item
> > > > > in
> > > > > > > the SiteInstance it was in before, so it's fine for
> NavigationRequest
> > to
> > > > > track
> > > > > > > the dest_site_instance_ and use it at commit time in PlzNavigate. 
> > That
> > > > > stops
> > > > > > > being true for redirects, though, and we already have some similar
> > logic
> > > > to
> > > > > > > clear any child history items if a redirect occurs.  When we
> redirect,
> > > we
> > > > > > should
> > > > > > > find a SiteInstance for the entry as we would for any other new
> > > > navigation.
> > > > > > > 
> > > > > > > As a result, I think a cleaner fix for this bug would be simply
> > clearing
> > > > > > > dest_site_instance_ in NavigationRequest::OnRequestRedirected,
since
> > it
> > > no
> > > > > > > longer applies if a redirect occurs.  That seems like a closer fix
> to
> > > the
> > > > > > > underlying problem, and it avoids the need to change anything in
> > > > > > > RenderFrameHostManager.
> > > > > > > 
> > > > > > > Hope that helps!
> > > > > > 
> > > > > > Hey Charlie, thanks for the suggestion. I tried that approach,
however
> > it
> > > > > seems
> > > > > > to have broken two few tests that you wrote with plznavigate and
site
> > per
> > > > > > process:
> > > > > > 
> > > > > >
NavigationControllerBrowserTest.FrameNavigationEntry_BackWithRedirect
> > > > > > NavigationControllerBrowserTest.ForwardRedirectWithNoCommittedEntry
> > > > > > 
> > > > > > (see patchset 3 which is with plznavigate enabled compared to
> > > > > > https://codereview.chromium.org/2385413004/#ps260001 which is
> > plznavigate
> > > > > > enabled on trunk)
> > > > > 
> > > > > Ok, I'll take a look at those in a debugger tomorrow to see what's
going
> > > > wrong.
> > > > 
> > > > btw I had a chance to debug them, and it looks like the dcheck that's
> > failing
> > > > needs to be updated after your suggestion to NavigationRequest. ptal
> > > 
> > > Cool.  I think I'm ok with that change-- let me confirm what happens in
the
> > > non-PlzNavigate case, since I'm surprised we don't have a problem there. 
> I'll
> > > approve unless this introduces a problem.
> > 
> > Ok, this LGTM.
> > 
> > The non-PlzNavigate --site-per-process case actually gets this wrong today. 
> It
> > misclassifies the redirect as NAVIGATION_TYPE_NEW_PAGE rather than
> > NAVIGATION_TYPE_EXISTING_PAGE.  That means we don't crash on the DCHECK, but
> it
> > also means we'll incorrectly clear the forward history.
> > 
> > Looks like PlzNavigate will get this right with your CL.  I'll file a bug
for
> > the non-PlzNavigate case, so feel free to proceed.  Thanks!
> 
> cool, thanks for checking and for the simpler fix.

np.  Filed https://crbug.com/679033 for the non-PlzNav case.

Powered by Google App Engine
This is Rietveld 408576698