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

Issue 2566583002: Change allowed bindings to be per RenderFrame instead of per RenderView. (Closed)

Created:
4 years ago by Sam McNally
Modified:
3 years, 10 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, einbinder+watch-test-runner_chromium.org, creis+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, Peter Beverloo, nasko+codewatch_chromium.org, jam, extensions-reviews_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, blink-reviews, chromium-apps-reviews_chromium.org, darin (slow to review), jochen+watch_chromium.org, mlamouri+watch-test-runner_chromium.org, site-isolation-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change allowed bindings to be per RenderFrame instead of per RenderView. Previously, extra JS bindings were granted on a per-RenderView basis. One of the binding types is access to mojo JS bindings for layout tests. To allow access to these bindings in subframes, RenderFrame was changed to inherit whatever bindings were allowed at a process-wide level. Since all RenderViews are granted these bindings in layout tests, this was sufficient as long as the frame checks for allowed bindings after a RenderView has received the IPC granting it bindings for the test or is a main frame, since main frames are notified by the RenderView when bindings are granted. With site isolation, there is one layout test where a RenderFrame checks for bindings before any RenderView receives the binding-granting IPC, and as a result it cannot access the mojo bindings necessary to run that test. This CL fixes this problem by moving management of these bindings to be per-RenderFrame. To maintain the existing behavior, subframes are granted the same bindings as their parent frames. The difference is that now the browser is responsible, so it no longer relies on subframes being created in a renderer where some global state has already been set. BUG=611838 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2566583002 Cr-Commit-Position: refs/heads/master@{#446950} Committed: https://chromium.googlesource.com/chromium/src/+/7f6c6a0b64b8d4df8cb476d88bc582109c0d6bff

Patch Set 1 : #

Total comments: 18

Patch Set 2 : rebase #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : rebase #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : rebase #

Patch Set 11 : #

Patch Set 12 : #

Total comments: 14

Patch Set 13 : rebase #

Patch Set 14 : #

Patch Set 15 : rebase #

Total comments: 2

Patch Set 16 : #

Total comments: 2

Patch Set 17 : rebase #

Patch Set 18 : #

Patch Set 19 : rebase #

Patch Set 20 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+220 lines, -190 lines) Patch
M chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/memory_details.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sessions/session_restore_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/ui/browser_navigator_browsertest.cc View 1 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/mojo_web_ui_controller.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/renderer/chrome_render_view_observer.cc View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M components/dom_distiller/content/browser/dom_distiller_viewer_source.cc View 2 chunks +1 line, -4 lines 0 comments Download
M content/browser/frame_host/interstitial_page_impl.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/frame_host/navigation_controller_impl_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/navigation_controller_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/frame_host/navigator_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +7 lines, -5 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 8 chunks +60 lines, -11 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +1 line, -3 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 11 12 13 8 chunks +12 lines, -15 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +0 lines, -6 lines 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 13 14 15 16 17 18 19 3 chunks +1 line, -43 lines 0 comments Download
M content/browser/renderer_host/render_view_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/security_exploit_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -2 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 11 12 13 14 15 16 4 chunks +4 lines, -8 lines 0 comments Download
M content/common/frame.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +10 lines, -0 lines 0 comments Download
M content/public/browser/render_frame_host.h View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/browser/render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +0 lines, -8 lines 0 comments Download
M content/public/renderer/render_frame.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/renderer/render_view.h View 1 chunk +0 lines, -4 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +14 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 11 chunks +47 lines, -14 lines 0 comments Download
M content/renderer/render_process_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +6 lines, -0 lines 0 comments Download
M content/renderer/render_view_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +0 lines, -2 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +0 lines, -26 lines 0 comments Download
M content/renderer/web_ui_extension.cc View 1 2 2 chunks +6 lines, -1 line 0 comments Download
M content/shell/browser/layout_test/blink_test_controller.cc View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download
M headless/lib/browser/headless_web_contents_impl.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/site-per-process View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector-protocol/runtime/runtime-execution-contexts-events.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 124 (102 generated)
Sam McNally
This fixes https://bugs.chromium.org/p/chromium/issues/detail?id=611838 by changing tracking of enabled bindings to be per-renderframe instead of per-renderview. ...
4 years ago (2016-12-12 10:21:30 UTC) #27
nasko
I'm sorry about the huge delay. I will get to review it this week, but ...
4 years ago (2016-12-15 00:55:02 UTC) #29
Charlie Reis
Thanks-- in general, I do think we want to move bindings over to RenderFrame, as ...
4 years ago (2016-12-16 01:01:51 UTC) #30
Sam McNally
On 2016/12/16 01:01:51, Charlie Reis wrote: > Thanks-- in general, I do think we want ...
3 years, 11 months ago (2017-01-12 09:27:09 UTC) #63
Charlie Reis
Thanks, and apologies for the long delay! This looks good apart from a few small ...
3 years, 11 months ago (2017-01-18 22:18:43 UTC) #66
Sam McNally
https://codereview.chromium.org/2566583002/diff/300001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2566583002/diff/300001/content/browser/frame_host/render_frame_host_impl.cc#newcode958 content/browser/frame_host/render_frame_host_impl.cc:958: if (enabled_bindings_) { On 2017/01/18 22:18:43, Charlie Reis wrote: ...
3 years, 11 months ago (2017-01-19 05:30:37 UTC) #76
Charlie Reis
Thanks! LGTM. https://codereview.chromium.org/2566583002/diff/300001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2566583002/diff/300001/content/browser/frame_host/render_frame_host_impl.cc#newcode1028 content/browser/frame_host/render_frame_host_impl.cc:1028: bool added = frame_tree_->AddFrame( On 2017/01/19 05:30:37, ...
3 years, 11 months ago (2017-01-19 17:58:54 UTC) #77
Sam McNally
+alexclarke for //headless +nyquist for //components/dom_distiller +sky for //chrome +dcheng for the mojom https://codereview.chromium.org/2566583002/diff/360001/content/browser/renderer_host/render_view_host_unittest.cc File ...
3 years, 11 months ago (2017-01-19 23:34:09 UTC) #82
sky
LGTM
3 years, 11 months ago (2017-01-20 00:45:33 UTC) #85
dcheng
https://codereview.chromium.org/2566583002/diff/380001/content/common/frame.mojom File content/common/frame.mojom (right): https://codereview.chromium.org/2566583002/diff/380001/content/common/frame.mojom#newcode29 content/common/frame.mojom:29: interface FrameBindingsControl { Nit: it might be nice to ...
3 years, 11 months ago (2017-01-20 08:29:27 UTC) #86
alex clarke (OOO till 29th)
headless/ LGTM
3 years, 11 months ago (2017-01-20 08:33:10 UTC) #87
nyquist
//components/dom_distiller lgtm
3 years, 11 months ago (2017-01-20 18:22:00 UTC) #88
Sam McNally
https://codereview.chromium.org/2566583002/diff/380001/content/common/frame.mojom File content/common/frame.mojom (right): https://codereview.chromium.org/2566583002/diff/380001/content/common/frame.mojom#newcode29 content/common/frame.mojom:29: interface FrameBindingsControl { On 2017/01/20 08:29:27, dcheng wrote: > ...
3 years, 11 months ago (2017-01-23 03:20:28 UTC) #94
dcheng
Sorry, one more question. In the CL description, it says: With site isolation, there is ...
3 years, 11 months ago (2017-01-23 23:36:40 UTC) #95
Sam McNally
On 2017/01/23 23:36:40, dcheng wrote: > Sorry, one more question. In the CL description, it ...
3 years, 11 months ago (2017-01-23 23:47:39 UTC) #96
Charlie Reis
On 2017/01/23 23:47:39, Sam McNally wrote: > On 2017/01/23 23:36:40, dcheng wrote: > > Sorry, ...
3 years, 11 months ago (2017-01-23 23:50:05 UTC) #97
Sam McNally
On 2017/01/23 23:50:05, Charlie Reis wrote: > On 2017/01/23 23:47:39, Sam McNally wrote: > > ...
3 years, 11 months ago (2017-01-24 00:33:39 UTC) #100
dcheng
Talked with creis@. Some high-level notes: Logically, it feels a bit backwards to have "state ...
3 years, 11 months ago (2017-01-24 19:53:55 UTC) #101
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/2566583002/440001
3 years, 11 months ago (2017-01-24 23:15:05 UTC) #104
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/377517)
3 years, 11 months ago (2017-01-25 01:53:40 UTC) #106
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/2566583002/480001
3 years, 10 months ago (2017-01-30 00:49:39 UTC) #121
commit-bot: I haz the power
3 years, 10 months ago (2017-01-30 00:54:35 UTC) #124
Message was sent while issue was closed.
Committed patchset #20 (id:480001) as
https://chromium.googlesource.com/chromium/src/+/7f6c6a0b64b8d4df8cb476d88bc5...

Powered by Google App Engine
This is Rietveld 408576698