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

Issue 837283003: Start replicating sandbox flags for OOPIF (Closed)

Created:
5 years, 11 months ago by alexmos
Modified:
5 years, 11 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Start replicating sandbox flags for OOPIF. This CL adds plumbing to replicate sandbox flags through the browser process: * Introduce a new enum to refer to sandbox flags in content. * Pass sandbox flags as part of FrameHostMsg_CreateChildFrame and store them in a FrameTreeNode's FrameReplicationState. Keep the older version of WebFrameClient::createChildFrame around until Blink switches over to the new version. * Pass sandbox flags in FrameMsg_NewFrame, so that a local frame's blink::SecurityContext can be initialized with proper sandbox flags. Also initialize sandbox flags for remote frames using FrameReplicationState already passed to new RenderFrameProxies. The corresponding Blink-side CL is: https://codereview.chromium.org/793493003/ After this CL, there will be a second Blink CL (https://codereview.chromium.org/838903002/) that will plumb correct sandbox flags into WebFrameClient::createChildFrame(); this will actually enable the replication. Then, another Chromium CL (https://codereview.chromium.org/797813006/) will remove the old createChildFrame and add browsertests. This CL doesn't cover the case where a frame's sandbox flags are modified through JavaScript and the frame is re-navigated. In this case, the renderer should tell the browser process about the updated sandbox flags with a separate IPC; this is left for a future CL. Skipping presubmit due to a warning about IPC_ENUM_TRAITS, which was discussed and approved in comments. BUG=426512 NOPRESUBMIT=true Committed: https://crrev.com/e48b1df9331ba5a366c09f86032e824d59d517ac Cr-Commit-Position: refs/heads/master@{#311808}

Patch Set 1 #

Patch Set 2 : #

Total comments: 14

Patch Set 3 : Improve comment for content::SandboxFlags. Change blink::WebSandboxFlags to an enum class per Daniel's suggestion. #

Patch Set 4 : Rebase #

Patch Set 5 : Add conversion functions for SandboxFlags #

Total comments: 7

Patch Set 6 : Address Charlie's nits #

Patch Set 7 : Use a macro to assert that content and Web SandboxFlags are in sync #

Patch Set 8 : Nit #

Patch Set 9 : Rebase #

Patch Set 10 : Fix OnCreateChildFrame usage in unit tests #

Total comments: 4

Patch Set 11 : Address Nasko's nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+192 lines, -42 lines) Patch
M components/printing/renderer/print_web_view_helper.cc View 1 2 3 4 5 6 7 8 3 chunks +17 lines, -2 lines 0 comments Download
M content/browser/frame_host/frame_tree_node.h View 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/frame_host/frame_tree_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -2 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 3 chunks +5 lines, -3 lines 0 comments Download
M content/browser/frame_host/render_frame_message_filter.h View 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_message_filter.cc View 2 chunks +11 lines, -8 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 4 chunks +10 lines, -4 lines 0 comments Download
M content/common/frame_replication_state.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +28 lines, -2 lines 0 comments Download
M content/common/frame_replication_state.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/public/test/mock_render_thread.h View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M content/public/test/mock_render_thread.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 4 chunks +15 lines, -1 line 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 5 chunks +68 lines, -8 lines 0 comments Download
M content/renderer/render_frame_proxy.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 3 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 1 chunk +7 lines, -4 lines 0 comments Download
M content/test/test_render_frame_host.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 26 (9 generated)
alexmos
Charlie, could you please review this CL? This has most of my attempt at sandbox ...
5 years, 11 months ago (2015-01-08 01:51:41 UTC) #2
Charlie Reis
[+dcheng for C++11 enum class sanity check.] Looks pretty good; just a few comments below. ...
5 years, 11 months ago (2015-01-08 22:17:26 UTC) #4
dcheng
https://codereview.chromium.org/837283003/diff/20001/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/837283003/diff/20001/content/common/frame_messages.h#newcode47 content/common/frame_messages.h:47: IPC_ENUM_TRAITS(content::SandboxFlags) // Bitmask. On 2015/01/08 22:17:26, Charlie Reis wrote: ...
5 years, 11 months ago (2015-01-09 07:56:57 UTC) #5
alexmos
https://codereview.chromium.org/837283003/diff/20001/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/837283003/diff/20001/content/common/frame_messages.h#newcode394 content/common/frame_messages.h:394: content::FrameReplicationState /* replication_state */) On 2015/01/08 22:17:26, Charlie Reis ...
5 years, 11 months ago (2015-01-09 20:43:25 UTC) #6
Charlie Reis
Thanks! LGTM with nits. https://codereview.chromium.org/837283003/diff/20001/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/837283003/diff/20001/content/common/frame_messages.h#newcode394 content/common/frame_messages.h:394: content::FrameReplicationState /* replication_state */) On ...
5 years, 11 months ago (2015-01-12 20:25:12 UTC) #7
alexmos
Thanks! https://codereview.chromium.org/837283003/diff/80001/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/837283003/diff/80001/content/common/frame_messages.h#newcode389 content/common/frame_messages.h:389: // to replace the proxy on commit. On ...
5 years, 11 months ago (2015-01-14 19:35:19 UTC) #8
alexmos
Owner's approval time: nasko@: please review content/common/frame_messages.h thestig@: please review chrome/renderer/printing/
5 years, 11 months ago (2015-01-14 19:45:39 UTC) #10
Charlie Reis
LGTM. These compile asserts are done elsewhere, so I assume there must be a way ...
5 years, 11 months ago (2015-01-14 19:46:45 UTC) #12
Lei Zhang
print_web_view_helper.cc lgtm
5 years, 11 months ago (2015-01-14 22:45:35 UTC) #14
alexmos
Readding nasko@ who was somehow dropped off the list. Nasko: please review content/common/frame_messages.h
5 years, 11 months ago (2015-01-15 18:59:25 UTC) #16
nasko
Just a couple of nits. Overall LGTM. https://codereview.chromium.org/837283003/diff/180001/components/printing/renderer/print_web_view_helper.cc File components/printing/renderer/print_web_view_helper.cc (right): https://codereview.chromium.org/837283003/diff/180001/components/printing/renderer/print_web_view_helper.cc#newcode728 components/printing/renderer/print_web_view_helper.cc:728: return createChildFrame(parent, ...
5 years, 11 months ago (2015-01-15 19:59:12 UTC) #17
alexmos
Thanks! https://codereview.chromium.org/837283003/diff/180001/components/printing/renderer/print_web_view_helper.cc File components/printing/renderer/print_web_view_helper.cc (right): https://codereview.chromium.org/837283003/diff/180001/components/printing/renderer/print_web_view_helper.cc#newcode728 components/printing/renderer/print_web_view_helper.cc:728: return createChildFrame(parent, name, blink::WebSandboxFlags::None); On 2015/01/15 19:59:11, nasko ...
5 years, 11 months ago (2015-01-15 21:53:51 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/837283003/200001
5 years, 11 months ago (2015-01-15 22:18:16 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/36398)
5 years, 11 months ago (2015-01-15 23:19:14 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/837283003/200001
5 years, 11 months ago (2015-01-16 01:33:30 UTC) #24
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 11 months ago (2015-01-16 01:34:51 UTC) #25
commit-bot: I haz the power
5 years, 11 months ago (2015-01-16 01:35:58 UTC) #26
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/e48b1df9331ba5a366c09f86032e824d59d517ac
Cr-Commit-Position: refs/heads/master@{#311808}

Powered by Google App Engine
This is Rietveld 408576698