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

Issue 2921753002: NOT YET READY: Making chrome.windows.create establish an actual "opener" relationship.

Created:
3 years, 6 months ago by Łukasz Anforowicz
Modified:
3 years, 6 months ago
Reviewers:
Charlie Reis, Devlin
CC:
chromium-reviews, extensions-reviews_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, chromium-apps-reviews_chromium.org, nasko
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Making chrome.windows.create establish an actual "opener" relationship. Before this CL, windows (or tabs, panels, etc.) created by chrome.windows.create API form a relationship that is almost, but not quite, like an opener relationship: 1. Unlike in a true opener relationship, the 2 frames (opener and openee) can find each other, but only if they are still in the same process. For example, if only 1 frame navigates cross-process, then the frames won't be able to find each other (for a specific example please see https://crbug.com/713888#c5). 2. Unlike in a true opener relationship, window.opener is not set (and consequently cannot be navigated by the openee). After this CL, chrome.windows.create API forms a true opener relationship *iff* the new parameter - setSelfAsOpener is used. Otherwise, the newly opened window is created in a separate browsing instance. This is required for later restricting named frame lookup to the current browsing instance (see https://crbug.com/718489). The CL establishes a true opener relationship, by having extensions::WindowsCreateFunction::Run pass an opener (a RenderFrameHost*) into chrome::NavigateParams, rather than using |force_new_process_for_new_contents| field which this CL removes. This CL tweaks ExtensionApiTest.WindowsCreateVsBrowsingInstance test so that: - The test is closer to what the hangouts extension does (it navigates both windows to the same web origin and *then* attempts to lookup one window from the other). Without this modification, the test would NOT have caught the hangouts extension regression that was almost introduced by https://crrev.com/2873503002). - The test verifies the opener relationship (i.e. |window.opener|, findability via |window.open|, SiteInstance::IsRelatedSiteInstance) rather than accidental, indirect manifestations of having an opener relationship (i.e. being in the same process or site instance). Relevant tests: - Tweaked test: - ExtensionApiTest.WindowsCreateVsSiteInstance (the window.open part passes before and after this CL; the window.opener part + the IsRelatedSiteInstance part only pass after this CL) - Other tests: - AppBackgroundPageApiTest.Basic (hosted app -> background page can violate browsing instance; tests handling of mapping of web urls [full url, not just origin] to extensions) - CtrlClickShouldEndUpInNewProcessTest.* tests (tests for behavior that used to depend on the removed |force_new_process_for_new_contents| field). BUG=713888 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation TEST=See above.

Patch Set 1 #

Patch Set 2 : Fix incognito profile transitions #

Total comments: 10

Patch Set 3 : Addressed CR feedback from creis@. #

Patch Set 4 : Rebasing... #

Patch Set 5 : Adding setSelfAsOpener parameter. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -75 lines) Patch
M chrome/browser/extensions/api/tabs/tabs_api.cc View 1 2 3 4 1 chunk +4 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/tabs/tabs_test.cc View 1 2 3 4 4 chunks +110 lines, -19 lines 0 comments Download
M chrome/browser/ui/browser_navigator.cc View 1 2 3 4 4 chunks +21 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser_navigator_params.h View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/browser_navigator_params.cc View 5 chunks +4 lines, -6 lines 0 comments Download
M chrome/common/extensions/api/windows.json View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/frame_host/navigator.h View 1 2 3 4 3 chunks +4 lines, -5 lines 0 comments Download
M content/browser/frame_host/navigator_impl.h View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/frame_host/navigator_impl.cc View 2 chunks +0 lines, -3 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 1 chunk +1 line, -13 lines 0 comments Download
M content/browser/security_exploit_browsertest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/page_navigator.h View 1 2 3 4 2 chunks +1 line, -6 lines 0 comments Download
M content/public/browser/page_navigator.cc View 4 chunks +0 lines, -4 lines 0 comments Download

Messages

Total messages: 35 (29 generated)
Łukasz Anforowicz
creis@, could you PTAL?
3 years, 6 months ago (2017-06-02 16:48:14 UTC) #14
Charlie Reis
[+nasko to CC] Thanks! LGTM with some nits and a sanity check below. CL description ...
3 years, 6 months ago (2017-06-05 21:06:28 UTC) #15
Łukasz Anforowicz
On 2017/06/05 21:06:28, Charlie Reis wrote: > [+nasko to CC] > > Thanks! LGTM with ...
3 years, 6 months ago (2017-06-05 22:06:54 UTC) #17
Łukasz Anforowicz
rdevlin.cronin@, could you PTAL?
3 years, 6 months ago (2017-06-05 22:08:49 UTC) #19
Charlie Reis
On 2017/06/05 22:06:54, Łukasz A. wrote: > On 2017/06/05 21:06:28, Charlie Reis wrote: > > ...
3 years, 6 months ago (2017-06-05 22:22:08 UTC) #20
Devlin
3 years, 6 months ago (2017-06-09 14:50:19 UTC) #29
On 2017/06/05 22:22:08, Charlie Reis wrote:
> Devlin, I'll be curious if you see any downside to exposing the
> opener here.  Might be worth reading
> https://bugs.chromium.org/p/chromium/issues/detail?id=713888#c7 for context.

Sorry for the delay - week of summits.  I do have a few concerns here; I've
added a comment to the bug so we can discuss there.

Powered by Google App Engine
This is Rietveld 408576698