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

Issue 257083002: Check BrowsingInstance before swapping prerenders. (Closed)

Created:
6 years, 7 months ago by davidben
Modified:
6 years, 7 months ago
CC:
chromium-reviews, davidben+watch_chromium.org, cbentzel+watch_chromium.org, creis+watch_chromium.org, jar (doing other things), tburkard+watch_chromium.org, nasko+codewatch_chromium.org, jam, gavinp+prer_chromium.org, dominich+watch_chromium.org, darin-cc_chromium.org, asvitkine+watch_chromium.org, ajwong+watch_chromium.org, miu+watch_chromium.org, nasko
Visibility:
Public.

Description

Check BrowsingInstance before swapping prerenders. Even if a WebContents does not have an opener, if there is another WebContents in the BrowsingInstance, swapping processes can break pages which expect script access. BUG=118294 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=270581

Patch Set 1 #

Total comments: 21

Patch Set 2 : Rebase #

Patch Set 3 : creis comments #

Total comments: 10

Patch Set 4 : Move accounting to RFHM #

Total comments: 2

Patch Set 5 : Adjust comment #

Patch Set 6 : Revise comment. #

Total comments: 2

Patch Set 7 : Remove const #

Patch Set 8 : Rebase #

Total comments: 2

Patch Set 9 : Add a DCHECK #

Patch Set 10 : Less useless DCHECK (integer overflow) #

Patch Set 11 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+234 lines, -75 lines) Patch
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +20 lines, -5 lines 0 comments Download
M chrome/browser/prerender/prerender_final_status.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_final_status.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_manager.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +13 lines, -1 line 0 comments Download
M content/browser/browsing_instance.h View 1 2 3 4 5 6 7 8 9 4 chunks +15 lines, -0 lines 0 comments Download
M content/browser/browsing_instance.cc View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/frame_host/render_frame_host_manager.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +32 lines, -8 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +10 lines, -58 lines 0 comments Download
M content/browser/site_instance_impl.h View 1 2 3 4 5 6 3 chunks +11 lines, -1 line 0 comments Download
M content/browser/site_instance_impl.cc View 1 2 3 4 5 6 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +106 lines, -0 lines 0 comments Download
M content/public/browser/site_instance.h View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
davidben
https://codereview.chromium.org/257083002/diff/1/chrome/browser/prerender/prerender_manager.cc File chrome/browser/prerender/prerender_manager.cc (right): https://codereview.chromium.org/257083002/diff/1/chrome/browser/prerender/prerender_manager.cc#newcode536 chrome/browser/prerender/prerender_manager.cc:536: if (web_contents->GetSiteInstance()->GetRelatedActiveContentsCount() != 1u) { Would we ever have ...
6 years, 7 months ago (2014-04-28 18:34:39 UTC) #1
Charlie Reis
(Just a first thought; I'll review the rest tomorrow.) https://codereview.chromium.org/257083002/diff/1/chrome/browser/prerender/prerender_manager.cc File chrome/browser/prerender/prerender_manager.cc (right): https://codereview.chromium.org/257083002/diff/1/chrome/browser/prerender/prerender_manager.cc#newcode536 chrome/browser/prerender/prerender_manager.cc:536: ...
6 years, 7 months ago (2014-04-29 00:48:06 UTC) #2
davidben
https://codereview.chromium.org/257083002/diff/1/chrome/browser/prerender/prerender_manager.cc File chrome/browser/prerender/prerender_manager.cc (right): https://codereview.chromium.org/257083002/diff/1/chrome/browser/prerender/prerender_manager.cc#newcode536 chrome/browser/prerender/prerender_manager.cc:536: if (web_contents->GetSiteInstance()->GetRelatedActiveContentsCount() != 1u) { On 2014/04/29 00:48:06, Charlie ...
6 years, 7 months ago (2014-04-29 17:01:24 UTC) #3
Charlie Reis
Still thinking about your comments in RFHM unittest. I need to run to some meetings, ...
6 years, 7 months ago (2014-04-29 17:31:08 UTC) #4
davidben
https://codereview.chromium.org/257083002/diff/1/content/browser/browsing_instance.h File content/browser/browsing_instance.h (right): https://codereview.chromium.org/257083002/diff/1/content/browser/browsing_instance.h#newcode112 content/browser/browsing_instance.h:112: // Number of WebContentses currently on this SiteInstance. On ...
6 years, 7 months ago (2014-04-29 21:31:40 UTC) #5
Charlie Reis
One note on the tests, plus a few comment nits. Rest looks good. https://codereview.chromium.org/257083002/diff/1/content/browser/frame_host/render_frame_host_manager_unittest.cc File ...
6 years, 7 months ago (2014-04-29 22:13:51 UTC) #6
davidben
https://codereview.chromium.org/257083002/diff/1/content/browser/frame_host/render_frame_host_manager_unittest.cc File content/browser/frame_host/render_frame_host_manager_unittest.cc (right): https://codereview.chromium.org/257083002/diff/1/content/browser/frame_host/render_frame_host_manager_unittest.cc#newcode1058 content/browser/frame_host/render_frame_host_manager_unittest.cc:1058: DecrementRelatedActiveContentsCount(); On 2014/04/29 22:13:51, Charlie Reis wrote: > On ...
6 years, 7 months ago (2014-04-29 23:02:25 UTC) #7
Charlie Reis
Agreed, that feels much nicer to move it into RFHM. LGTM. Please have John look ...
6 years, 7 months ago (2014-04-29 23:16:40 UTC) #8
davidben
Also +asvitkine for histograms.xml to get that done in parallel. (I'll wait for the other ...
6 years, 7 months ago (2014-04-30 00:02:17 UTC) #9
Alexei Svitkine (slow)
histograms lgtm
6 years, 7 months ago (2014-04-30 13:59:08 UTC) #10
jam
content/public lgtm with nit https://codereview.chromium.org/257083002/diff/100001/content/public/browser/site_instance.h File content/public/browser/site_instance.h (right): https://codereview.chromium.org/257083002/diff/100001/content/public/browser/site_instance.h#newcode111 content/public/browser/site_instance.h:111: virtual size_t GetRelatedActiveContentsCount() const = ...
6 years, 7 months ago (2014-04-30 16:13:23 UTC) #11
davidben
https://codereview.chromium.org/257083002/diff/100001/content/public/browser/site_instance.h File content/public/browser/site_instance.h (right): https://codereview.chromium.org/257083002/diff/100001/content/public/browser/site_instance.h#newcode111 content/public/browser/site_instance.h:111: virtual size_t GetRelatedActiveContentsCount() const = 0; On 2014/04/30 16:13:23, ...
6 years, 7 months ago (2014-04-30 16:21:52 UTC) #12
tburkard
lgtm But I think it'd be great to add some DCHECK/DCHECK's to verify that we ...
6 years, 7 months ago (2014-05-07 08:52:22 UTC) #13
davidben
https://codereview.chromium.org/257083002/diff/140001/content/browser/browsing_instance.h File content/browser/browsing_instance.h (right): https://codereview.chromium.org/257083002/diff/140001/content/browser/browsing_instance.h#newcode85 content/browser/browsing_instance.h:85: void decrement_active_contents_count() { active_contents_count_--; } On 2014/05/07 08:52:23, tburkard ...
6 years, 7 months ago (2014-05-07 18:51:43 UTC) #14
davidben
The CQ bit was checked by davidben@chromium.org
6 years, 7 months ago (2014-05-07 21:34:01 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/davidben@chromium.org/257083002/180001
6 years, 7 months ago (2014-05-07 21:39:15 UTC) #16
davidben
The CQ bit was unchecked by davidben@chromium.org
6 years, 7 months ago (2014-05-07 23:25:57 UTC) #17
davidben
On 2014/05/07 21:39:15, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
6 years, 7 months ago (2014-05-07 23:26:20 UTC) #18
davidben
The CQ bit was checked by davidben@chromium.org
6 years, 7 months ago (2014-05-15 03:03:42 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/davidben@chromium.org/257083002/200001
6 years, 7 months ago (2014-05-15 03:04:17 UTC) #20
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-15 04:15:16 UTC) #21
commit-bot: I haz the power
6 years, 7 months ago (2014-05-15 05:50:22 UTC) #22
Message was sent while issue was closed.
Change committed as 270581

Powered by Google App Engine
This is Rietveld 408576698