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

Issue 212703005: Preserve Page::openedByDOM state across process swaps. (Closed)

Created:
6 years, 8 months ago by davidben
Modified:
6 years, 8 months ago
CC:
chromium-reviews, davidben+watch_chromium.org, cbentzel+watch_chromium.org, creis+watch_chromium.org, tburkard+watch_chromium.org, nasko+codewatch_chromium.org, jam, gavinp+prer_chromium.org, dominich+watch_chromium.org, darin-cc_chromium.org, miu+watch_chromium.org
Visibility:
Public.

Description

Preserve Page::openedByDOM state across process swaps. Every Page in Blink has an openedByDOM bit which partially determines whether window.close() may be called. This bit is equivalent to whether the WebContents was created with an opener. Move this bit up to WebContents and forward it to new renderers to be preserved across process swaps. Add a suite of tests to ensure it's preserved correctly. This also fixes a bug where the bit was not preserved for blocked-then-opened popups. Add a test for this case. BUG=357579 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=264291

Patch Set 1 #

Patch Set 2 : Add a test. #

Patch Set 3 : Add a comment (lone try job stapled to previous patch set) #

Patch Set 4 : Add a prerender test. #

Patch Set 5 : Tie opened_by_dom with opener. #

Total comments: 25

Patch Set 6 : creis comments. #

Total comments: 8

Patch Set 7 : nasko comments. (Also a rebase. Oops.) #

Total comments: 2

Patch Set 8 : comment typo #

Total comments: 2

Patch Set 9 : Add popup blocker test. (Also a rebase. Oops.) #

Patch Set 10 : creis comment. #

Patch Set 11 : Appease clang #

Total comments: 2

Patch Set 12 : DISALLOW_COPY_AND_ASSIGN #

Patch Set 13 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+235 lines, -14 lines) Patch
M chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +46 lines, -0 lines 0 comments Download
M components/visitedlink/test/visitedlink_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/frame_host/interstitial_page_impl.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 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 11 12 3 chunks +4 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -1 line 0 comments Download
A content/browser/web_contents/opened_by_dom_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +139 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -1 line 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/render_view_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/test_renderer_host.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -1 line 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +7 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl_params.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl_params.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M content/test/test_render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M content/test/test_render_view_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M content/test/test_web_contents.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 20 (0 generated)
davidben
creis: Sending this to you for the main review. This depends on https://codereview.chromium.org/223603005/ and https://codereview.chromium.org/224173007/ ...
6 years, 8 months ago (2014-04-04 19:37:41 UTC) #1
Charlie Reis
Nasko: one question for you below about where we think page-level state will end up. ...
6 years, 8 months ago (2014-04-05 01:41:24 UTC) #2
davidben
https://codereview.chromium.org/212703005/diff/80001/chrome/browser/prerender/prerender_manager.cc File chrome/browser/prerender/prerender_manager.cc (right): https://codereview.chromium.org/212703005/diff/80001/chrome/browser/prerender/prerender_manager.cc#newcode535 chrome/browser/prerender/prerender_manager.cc:535: if (web_contents->CreatedWithOpener()) { On 2014/04/05 01:41:25, Charlie Reis wrote: ...
6 years, 8 months ago (2014-04-07 17:57:52 UTC) #3
nasko
Answering Charlie's question and a few drive-by comments. https://codereview.chromium.org/212703005/diff/80001/content/browser/renderer_host/render_view_host_impl.h File content/browser/renderer_host/render_view_host_impl.h (right): https://codereview.chromium.org/212703005/diff/80001/content/browser/renderer_host/render_view_host_impl.h#newcode252 content/browser/renderer_host/render_view_host_impl.h:252: bool ...
6 years, 8 months ago (2014-04-08 22:43:24 UTC) #4
davidben
https://codereview.chromium.org/212703005/diff/100001/content/browser/web_contents/opened_by_dom_browsertest.cc File content/browser/web_contents/opened_by_dom_browsertest.cc (right): https://codereview.chromium.org/212703005/diff/100001/content/browser/web_contents/opened_by_dom_browsertest.cc#newcode64 content/browser/web_contents/opened_by_dom_browsertest.cc:64: CHECK(ExecuteScriptAndExtractInt(web_contents, kCloseWindowScript, &dummy)); On 2014/04/08 22:43:25, nasko wrote: > ...
6 years, 8 months ago (2014-04-08 23:48:22 UTC) #5
nasko
Ah, I didn't see this typo on the previous round : (. https://codereview.chromium.org/212703005/diff/120001/content/renderer/render_view_impl.h File content/renderer/render_view_impl.h ...
6 years, 8 months ago (2014-04-08 23:57:19 UTC) #6
davidben
https://codereview.chromium.org/212703005/diff/120001/content/renderer/render_view_impl.h File content/renderer/render_view_impl.h (right): https://codereview.chromium.org/212703005/diff/120001/content/renderer/render_view_impl.h#newcode186 content/renderer/render_view_impl.h:186: // |opened_id| will be MSG_ROUTING_NONE. On 2014/04/08 23:57:20, nasko ...
6 years, 8 months ago (2014-04-09 16:43:18 UTC) #7
Charlie Reis
Thanks for the cleanup, and sorry for the delay. LGTM! https://codereview.chromium.org/212703005/diff/140001/content/browser/web_contents/web_contents_impl.h File content/browser/web_contents/web_contents_impl.h (right): https://codereview.chromium.org/212703005/diff/140001/content/browser/web_contents/web_contents_impl.h#newcode878 ...
6 years, 8 months ago (2014-04-11 22:57:56 UTC) #8
Charlie Reis
Note: Please have jochen@ weigh in on comment 4 of the bug (http://crbug.com/357579) before landing, ...
6 years, 8 months ago (2014-04-11 23:00:36 UTC) #9
jochen (gone - plz use gerrit)
commented on the bug. assuming I understood the question correctly lgtm
6 years, 8 months ago (2014-04-14 07:28:06 UTC) #10
davidben
Added a test for the popup blocker case.
6 years, 8 months ago (2014-04-14 21:26:39 UTC) #11
davidben
Oops, missed this one. https://codereview.chromium.org/212703005/diff/140001/content/browser/web_contents/web_contents_impl.h File content/browser/web_contents/web_contents_impl.h (right): https://codereview.chromium.org/212703005/diff/140001/content/browser/web_contents/web_contents_impl.h#newcode878 content/browser/web_contents/web_contents_impl.h:878: // True if this tab ...
6 years, 8 months ago (2014-04-14 21:29:46 UTC) #12
davidben
jochen: How does the popup_blocker_browsertest.cc change look?
6 years, 8 months ago (2014-04-15 21:26:14 UTC) #13
jochen (gone - plz use gerrit)
lgtm, thanks https://codereview.chromium.org/212703005/diff/200001/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc File chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc (right): https://codereview.chromium.org/212703005/diff/200001/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc#newcode91 chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc:91: }; nit. DISALLOW_COPY_AND_ASSIGN()
6 years, 8 months ago (2014-04-16 08:58:30 UTC) #14
davidben
https://codereview.chromium.org/212703005/diff/200001/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc File chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc (right): https://codereview.chromium.org/212703005/diff/200001/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc#newcode91 chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc:91: }; On 2014/04/16 08:58:30, jochen wrote: > nit. DISALLOW_COPY_AND_ASSIGN() ...
6 years, 8 months ago (2014-04-16 16:15:09 UTC) #15
davidben
Oh whoops, still need a view_messages.h OWNER. +jschuh.
6 years, 8 months ago (2014-04-16 16:17:26 UTC) #16
nasko
IPC messages LGTM, since I've already reviewed the CL earlier.
6 years, 8 months ago (2014-04-16 16:20:24 UTC) #17
davidben
The CQ bit was checked by davidben@chromium.org
6 years, 8 months ago (2014-04-16 18:27:56 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/davidben@chromium.org/212703005/240001
6 years, 8 months ago (2014-04-16 18:28:45 UTC) #19
commit-bot: I haz the power
6 years, 8 months ago (2014-04-16 20:19:54 UTC) #20
Message was sent while issue was closed.
Change committed as 264291

Powered by Google App Engine
This is Rietveld 408576698