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

Issue 1417023006: bindings: Refactors BindingSecurity::shouldAllowAccessToXXX. (Closed)

Created:
5 years, 1 month ago by Yuki
Modified:
5 years ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bindings: Refactors BindingSecurity::shouldAllowAccessToXXX. This refactoring has two major benefits. 1. This makes the code generator's template code simpler. 2. This makes it easier to use shouldAllowAccessTo in the right way. From the point of view of shouldAllowAccessToFrame, before) The callers must pass the correct Frame object to shouldAllowAccessToFrame. It's caller's duty to extract the correct Frame object in the right way. after) The callers only need to pass the receiver to shouldAllowAccessTo. No need to understand how to extract the correct SecurityOrigin (or Frame) from the receiver object. shouldAllowAccessTo functions take care of all the things needed. This CL is helpful for http://crrev.com/1380503002 which is trying to make non-whitelisted DOM attributes of Window into accessor-type JS properties. BUG=509936 Committed: https://crrev.com/a4546f721ab58264e2e276425f20d76b5f2ebdcc Cr-Commit-Position: refs/heads/master@{#361812}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : Synced. #

Patch Set 9 : #

Patch Set 10 : Synced. #

Total comments: 2

Patch Set 11 : Reverted the return value of DOM operations. #

Patch Set 12 : Synced. #

Total comments: 38

Patch Set 13 : Addressed review comments. #

Patch Set 14 : Synced. #

Total comments: 15

Patch Set 15 : Addressed review comments. #

Patch Set 16 : Synced. #

Patch Set 17 : Re-synced. #

Patch Set 18 : Synced. #

Patch Set 19 : Fixed the assertion condition. #

Patch Set 20 : Fixed the assertion condition. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+184 lines, -139 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +40 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +66 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/custom/V8EventTargetCustom.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +6 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +11 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/attributes.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +8 lines, -38 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface_base.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/methods.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +11 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +12 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/events/EventTarget.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/EventTarget.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/DOMWindow.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/DOMWindow.cpp View 1 2 3 4 5 4 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalDOMWindow.h View 14 15 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp View 1 2 3 4 5 6 7 8 9 10 11 14 15 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 29 (9 generated)
Yuki
Could you guys review this CL? Should be no behavioral change.
5 years, 1 month ago (2015-11-16 08:38:27 UTC) #4
haraken
Isn't this change assuming that: window == window->frame()->domWindow() ? I believe it _should_ hold, but ...
5 years, 1 month ago (2015-11-16 08:53:20 UTC) #6
Yuki
On 2015/11/16 08:53:20, haraken wrote: > Isn't this change assuming that: > > window == ...
5 years, 1 month ago (2015-11-16 09:54:10 UTC) #7
Yuki
https://codereview.chromium.org/1417023006/diff/180001/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp File third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp (right): https://codereview.chromium.org/1417023006/diff/180001/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp#newcode239 third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp:239: v8SetReturnValueNull(info); On 2015/11/16 08:53:19, haraken wrote: > > Is ...
5 years, 1 month ago (2015-11-16 10:24:33 UTC) #8
Yuki
On 2015/11/16 09:54:10, Yuki wrote: > On 2015/11/16 08:53:20, haraken wrote: > > Isn't this ...
5 years, 1 month ago (2015-11-16 10:39:04 UTC) #9
haraken
On 2015/11/16 10:39:04, Yuki wrote: > On 2015/11/16 09:54:10, Yuki wrote: > > On 2015/11/16 ...
5 years, 1 month ago (2015-11-16 11:13:06 UTC) #10
haraken
Mostly looks good. https://codereview.chromium.org/1417023006/diff/220001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1417023006/diff/220001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode75 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:75: return canAccessFrame(isolate, accessingWindow, frame->securityContext()->securityOrigin(), target, exceptionState); ...
5 years, 1 month ago (2015-11-16 11:34:21 UTC) #11
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1417023006/diff/220001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h (right): https://codereview.chromium.org/1417023006/diff/220001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h#newcode58 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h:58: CORE_EXPORT static bool shouldAllowAccessTo(v8::Isolate*, const LocalDOMWindow* accessingWindow, const DOMWindow* ...
5 years, 1 month ago (2015-11-16 14:16:59 UTC) #12
dcheng
I think this change is probably OK, but I need to think over it a ...
5 years, 1 month ago (2015-11-17 01:56:59 UTC) #13
Yuki
Let me clarify what "receiver" and "return value" are. I'll address each comment separately. var ...
5 years, 1 month ago (2015-11-17 04:50:21 UTC) #14
Yuki
https://codereview.chromium.org/1417023006/diff/220001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1417023006/diff/220001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode75 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:75: return canAccessFrame(isolate, accessingWindow, frame->securityContext()->securityOrigin(), target, exceptionState); On 2015/11/16 11:34:20, ...
5 years, 1 month ago (2015-11-20 12:27:52 UTC) #15
haraken
LGTM with comments. https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode129 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:129: return canAccessFrame(isolate, accessingWindow, target->document().securityOrigin(), target->document().domWindow(), exceptionState); ...
5 years, 1 month ago (2015-11-22 14:55:01 UTC) #16
Yuki
https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode129 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:129: return canAccessFrame(isolate, accessingWindow, target->document().securityOrigin(), target->document().domWindow(), exceptionState); On 2015/11/22 14:55:00, ...
5 years ago (2015-11-24 08:44:12 UTC) #17
haraken
https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h (right): https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h#newcode83 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h:83: // where |x| is the returned object). On 2015/11/24 ...
5 years ago (2015-11-24 08:47:49 UTC) #18
haraken
Still LGTM https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode129 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:129: return canAccessFrame(isolate, accessingWindow, target->document().securityOrigin(), target->document().domWindow(), exceptionState); On ...
5 years ago (2015-11-24 08:50:20 UTC) #19
Yuki
https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h (right): https://codereview.chromium.org/1417023006/diff/260001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h#newcode83 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h:83: // where |x| is the returned object). On 2015/11/24 ...
5 years ago (2015-11-24 08:51:13 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417023006/330001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417023006/330001
5 years ago (2015-11-25 13:24:32 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417023006/370001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417023006/370001
5 years ago (2015-11-26 02:41:30 UTC) #25
commit-bot: I haz the power
Committed patchset #20 (id:370001)
5 years ago (2015-11-26 04:08:09 UTC) #27
commit-bot: I haz the power
5 years ago (2015-11-26 04:09:34 UTC) #29
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/a4546f721ab58264e2e276425f20d76b5f2ebdcc
Cr-Commit-Position: refs/heads/master@{#361812}

Powered by Google App Engine
This is Rietveld 408576698