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

Issue 2745313003: Move securityCheck out of V8WrapperInstantiationScope (Closed)

Created:
3 years, 9 months ago by adithyas
Modified:
3 years, 8 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, chasej+watch_chromium.org, chromium-reviews, iclelland+watch_chromuim.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Move securityCheck out of V8WrapperInstantiationScope Moving V8DOMWrapper.h/cpp to platform/bindings is blocked by V8WrapperInstantiationScope::securityCheck and V8WrapperInstantiationScope::convertException. Both of these methods use toLocalFrame/toDOMWindow, and cannot be moved to platform/. This CL moves the security check into WrapperCreationSecurityCheck. WrapperCreationSecurityCheck only holds a function pointer and will be moved into platform/bindings. The implementation of the security check is moved to BindingSecurity (in bindings/core), and the function pointer is set to point to the implementation inside core/. BUG=682322 Review-Url: https://codereview.chromium.org/2745313003 Cr-Original-Commit-Position: refs/heads/master@{#463621} Committed: https://chromium.googlesource.com/chromium/src/+/3f7eac384ee02371be4972ba0647082bf6599eb1 Review-Url: https://codereview.chromium.org/2745313003 Cr-Commit-Position: refs/heads/master@{#466029} Committed: https://chromium.googlesource.com/chromium/src/+/32ce98203b3580adb4e8553c34cbb677a0fa6203

Patch Set 1 #

Patch Set 2 : Small changes #

Patch Set 3 : Move entire security check into BindingSecurity #

Patch Set 4 : Stop unecessary includes of BindingSecurity.h #

Total comments: 20

Patch Set 5 : Code review fixes #

Patch Set 6 : Use a bit flag instead of storing a function pointer #

Patch Set 7 : Move functions into static class and remove flag bit #

Total comments: 23

Patch Set 8 : Address code review feedback #

Total comments: 3

Patch Set 9 : Do security check before entering creation context #

Total comments: 10

Patch Set 10 : Code review changes #

Total comments: 21

Patch Set 11 : Add comments and DCHECKs #

Total comments: 7

Patch Set 12 : Rebase, remove Isolate* parameter #

Patch Set 13 : Move init to V8Initializer #

Total comments: 2

Patch Set 14 : Create wrapper even after security check fails #

Patch Set 15 : Add TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -84 lines) Patch
M third_party/WebKit/Source/bindings/bindings.gni View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +18 lines, -0 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 3 chunks +62 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +29 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +3 lines, -63 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/core/v8/WrapperCreationSecurityCheck.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/bindings/core/v8/WrapperCreationSecurityCheck.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +41 lines, -0 lines 0 comments Download

Messages

Total messages: 87 (46 generated)
adithyas
3 years, 9 months ago (2017-03-15 19:31:57 UTC) #11
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2745313003/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h File third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h (right): https://codereview.chromium.org/2745313003/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h#newcode143 third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h:143: if you move this out, you'll want to make ...
3 years, 9 months ago (2017-03-15 19:56:13 UTC) #12
jochen (gone - plz use gerrit)
also, I wonder what the impact on binary size is?
3 years, 9 months ago (2017-03-15 19:57:59 UTC) #13
jbroman
https://codereview.chromium.org/2745313003/diff/60001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2745313003/diff/60001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode289 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:289: ExceptionState exceptionState(isolate, ExceptionState::ConstructionContext, nit: This is the same as ...
3 years, 9 months ago (2017-03-15 19:58:41 UTC) #14
haraken
To avoid adding additional bytes to each WrapperTypeInfo, would it be an option to move ...
3 years, 9 months ago (2017-03-15 20:25:40 UTC) #15
jbroman
On 2017/03/15 at 20:25:40, haraken wrote: > To avoid adding additional bytes to each WrapperTypeInfo, ...
3 years, 9 months ago (2017-03-15 20:45:23 UTC) #16
Yuki
https://codereview.chromium.org/2745313003/diff/60001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2745313003/diff/60001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode279 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:279: if (currentContext.IsEmpty() || creationContext.IsEmpty()) Is that possible that currentContext.IsEmpty() ...
3 years, 9 months ago (2017-03-16 14:05:55 UTC) #18
adithyas
I compared the binary sizes and it looks like this patch increases the binary size ...
3 years, 8 months ago (2017-03-28 20:35:41 UTC) #19
Yuki
I don't understand why you don't use bit flags. I think that we can do ...
3 years, 8 months ago (2017-03-29 13:11:04 UTC) #24
adithyas
On 2017/03/29 at 13:11:04, yukishiino wrote: > I don't understand why you don't use bit ...
3 years, 8 months ago (2017-03-29 20:40:35 UTC) #27
Yuki
On 2017/03/29 20:40:35, adithyas wrote: > On 2017/03/29 at 13:11:04, yukishiino wrote: > > I ...
3 years, 8 months ago (2017-03-30 08:07:22 UTC) #30
adithyas
On 2017/03/30 at 08:07:22, yukishiino wrote: > On 2017/03/29 20:40:35, adithyas wrote: > > On ...
3 years, 8 months ago (2017-03-30 17:58:40 UTC) #31
Yuki
Could you update the CL description? https://codereview.chromium.org/2745313003/diff/120001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2745313003/diff/120001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode276 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:276: bool BindingSecurity::canEnterCreationContext( nit: ...
3 years, 8 months ago (2017-03-31 09:49:38 UTC) #36
adithyas
https://codereview.chromium.org/2745313003/diff/120001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2745313003/diff/120001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode276 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:276: bool BindingSecurity::canEnterCreationContext( On 2017/03/31 at 09:49:37, Yuki wrote: > ...
3 years, 8 months ago (2017-03-31 17:49:28 UTC) #40
Yuki
Mostly looks good. https://codereview.chromium.org/2745313003/diff/120001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h File third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h (right): https://codereview.chromium.org/2745313003/diff/120001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h#newcode165 third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h:165: if (m_tryCatch.HasCaught()) On 2017/03/31 17:49:28, adithyas ...
3 years, 8 months ago (2017-04-03 08:29:26 UTC) #43
adithyas
https://codereview.chromium.org/2745313003/diff/120001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h File third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h (right): https://codereview.chromium.org/2745313003/diff/120001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h#newcode165 third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.h:165: if (m_tryCatch.HasCaught()) On 2017/04/03 at 08:29:25, Yuki wrote: > ...
3 years, 8 months ago (2017-04-03 15:20:54 UTC) #44
Yuki
See my reply to the comment. I think that what we need to do here ...
3 years, 8 months ago (2017-04-05 07:59:19 UTC) #45
adithyas
Ok sounds good, I wasn't sure about whether aborting before creating the wrapper was correct ...
3 years, 8 months ago (2017-04-05 20:50:08 UTC) #46
Yuki
LGTM in general. On 2017/04/05 20:50:08, adithyas wrote: > Ok sounds good, I wasn't sure ...
3 years, 8 months ago (2017-04-06 08:26:16 UTC) #47
adithyas
https://codereview.chromium.org/2745313003/diff/160001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h (right): https://codereview.chromium.org/2745313003/diff/160001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h#newcode123 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.h:123: // throws a SecurityError if it doesn't have access. ...
3 years, 8 months ago (2017-04-06 19:04:20 UTC) #52
haraken
Mostly looks good. https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode284 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:284: return !currentWorld.isMainWorld() || I'm just curious ...
3 years, 8 months ago (2017-04-07 04:23:36 UTC) #53
Yuki
https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode284 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:284: return !currentWorld.isMainWorld() || On 2017/04/07 04:23:36, haraken wrote: > ...
3 years, 8 months ago (2017-04-07 07:42:15 UTC) #54
haraken
https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode284 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:284: return !currentWorld.isMainWorld() || On 2017/04/07 07:42:14, Yuki wrote: > ...
3 years, 8 months ago (2017-04-07 09:53:41 UTC) #55
adithyas
https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp File third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp (left): https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp#oldcode119 third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp:119: // reach this code path. Should be generalized. On ...
3 years, 8 months ago (2017-04-07 18:42:53 UTC) #56
haraken
LGTM https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/core/CoreInitializer.cpp File third_party/WebKit/Source/core/CoreInitializer.cpp (right): https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/core/CoreInitializer.cpp#newcode147 third_party/WebKit/Source/core/CoreInitializer.cpp:147: BindingSecurity::initWrapperCreationSecurityCheck(); On 2017/04/07 18:42:53, adithyas wrote: > On ...
3 years, 8 months ago (2017-04-09 15:29:00 UTC) #57
Yuki
https://codereview.chromium.org/2745313003/diff/200001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp File third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp (right): https://codereview.chromium.org/2745313003/diff/200001/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp#newcode296 third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp:296: type->interfaceName); On 2017/04/09 15:29:00, haraken wrote: > > It ...
3 years, 8 months ago (2017-04-10 04:13:30 UTC) #58
adithyas
https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/core/CoreInitializer.cpp File third_party/WebKit/Source/core/CoreInitializer.cpp (right): https://codereview.chromium.org/2745313003/diff/180001/third_party/WebKit/Source/core/CoreInitializer.cpp#newcode147 third_party/WebKit/Source/core/CoreInitializer.cpp:147: BindingSecurity::initWrapperCreationSecurityCheck(); On 2017/04/09 at 15:28:59, haraken wrote: > On ...
3 years, 8 months ago (2017-04-10 18:02:00 UTC) #59
haraken
This CL LGTM, feel free to land this :) On 2017/04/10 18:02:00, adithyas wrote: > ...
3 years, 8 months ago (2017-04-11 00:29:12 UTC) #64
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/2745313003/240001
3 years, 8 months ago (2017-04-11 14:24:05 UTC) #67
commit-bot: I haz the power
Committed patchset #13 (id:240001) as https://chromium.googlesource.com/chromium/src/+/3f7eac384ee02371be4972ba0647082bf6599eb1
3 years, 8 months ago (2017-04-11 14:32:05 UTC) #70
adithyas
On 2017/04/11 at 00:29:12, haraken wrote: > > Hmm. Does it mean that we're allowing ...
3 years, 8 months ago (2017-04-11 14:50:35 UTC) #71
haraken
On 2017/04/11 14:50:35, adithyas wrote: > On 2017/04/11 at 00:29:12, haraken wrote: > > > ...
3 years, 8 months ago (2017-04-11 14:55:07 UTC) #72
Yuki
On 2017/04/11 14:50:35, adithyas wrote: > On 2017/04/11 at 00:29:12, haraken wrote: > > > ...
3 years, 8 months ago (2017-04-11 14:55:38 UTC) #73
adithyas
A revert of this CL (patchset #13 id:240001) has been created in https://codereview.chromium.org/2815373002/ by adithyas@chromium.org. ...
3 years, 8 months ago (2017-04-13 18:40:23 UTC) #74
adithyas
Requesting another review of this CL. I've changed it to no longer return an empty ...
3 years, 8 months ago (2017-04-19 19:22:17 UTC) #75
haraken
LGTM
3 years, 8 months ago (2017-04-19 19:58:21 UTC) #76
Yuki
This CL LGTM, but remember that it's wrong to continue to run having an exception ...
3 years, 8 months ago (2017-04-20 09:32:48 UTC) #77
adithyas
https://codereview.chromium.org/2745313003/diff/240001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp File third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp (right): https://codereview.chromium.org/2745313003/diff/240001/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp#newcode45 third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp:45: if (scope.AccessCheckFailed()) { On 2017/04/20 at 09:32:48, Yuki wrote: ...
3 years, 8 months ago (2017-04-20 14:51:52 UTC) #78
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/2745313003/280001
3 years, 8 months ago (2017-04-20 14:52:36 UTC) #81
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/2745313003/280001
3 years, 8 months ago (2017-04-20 14:53:47 UTC) #84
commit-bot: I haz the power
3 years, 8 months ago (2017-04-20 17:08:31 UTC) #87
Message was sent while issue was closed.
Committed patchset #15 (id:280001) as
https://chromium.googlesource.com/chromium/src/+/32ce98203b3580adb4e8553c34cb...

Powered by Google App Engine
This is Rietveld 408576698