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

Issue 2760793002: Use v8::Context::NewRemoteContext in RemoteWindowProxy. (Closed)

Created:
3 years, 9 months ago by dcheng
Modified:
3 years, 9 months ago
CC:
jochen (gone - plz use gerrit), blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Use v8::Context::NewRemoteContext in RemoteWindowProxy. A RemoteWindowProxy manages the state for the WindowProxy of a RemoteFrame. By definition, a RemoteFrame is always cross-origin. Today, RemoteWindowProxy uses v8::Context; however, a full v8 Context is fairly heavyweight and includes prototypes for many objects that will never be used (since the context is always considered cross origin). v8::Context::NewRemoteContext is intended to help reduce the memory overhead of remote frames; it simply instantiates a JSGlobalProxy and a shim global object that are very lightweight, since it skips all the work to set up prototypes for String, Number, Boolean, etc that will never be used. BUG=527190 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2760793002 Cr-Commit-Position: refs/heads/master@{#459151} Committed: https://chromium.googlesource.com/chromium/src/+/a94ee9eb38e2003712667dfe217a5cb1a1763dd0

Patch Set 1 #

Patch Set 2 : Fix compile and test errors. #

Patch Set 3 : associateObjectWithWrapper -> setNativeInfo #

Total comments: 3

Patch Set 4 : add test #

Patch Set 5 : RemoteDOMWindow in DOMDataStore #

Total comments: 8

Patch Set 6 : Clean up association logic #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -82 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h View 1 2 3 4 5 2 chunks +11 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h View 5 3 chunks +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp View 1 2 3 4 5 6 chunks +16 lines, -65 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.h View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp View 1 2 3 4 5 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 5 1 chunk +18 lines, -0 lines 2 comments Download

Messages

Total messages: 55 (27 generated)
dcheng
Hopefully all the bugs are fixed...
3 years, 9 months ago (2017-03-20 04:43:37 UTC) #5
haraken
LGTM to try :)
3 years, 9 months ago (2017-03-20 04:47:04 UTC) #6
dcheng
Hmm... looks like ScriptState::from is getting called from associateObjectWithWrapper now? Investigating...
3 years, 9 months ago (2017-03-20 06:03:09 UTC) #9
dcheng
https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp File third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp (right): https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp#newcode126 third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp:126: V8DOMWrapper::setNativeInfo(isolate(), windowWrapper, wrapperTypeInfo, PTAL... I had to change this ...
3 years, 9 months ago (2017-03-20 06:51:30 UTC) #12
haraken
https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp File third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp (right): https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp#newcode126 third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp:126: V8DOMWrapper::setNativeInfo(isolate(), windowWrapper, wrapperTypeInfo, On 2017/03/20 06:51:30, dcheng wrote: > ...
3 years, 9 months ago (2017-03-20 07:36:49 UTC) #13
dcheng
https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp File third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp (right): https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp#newcode126 third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp:126: V8DOMWrapper::setNativeInfo(isolate(), windowWrapper, wrapperTypeInfo, On 2017/03/20 07:36:49, haraken wrote: > ...
3 years, 9 months ago (2017-03-20 08:06:53 UTC) #14
jochen (gone - plz use gerrit)
should we have a layout test that tests remoteWindow.toString?
3 years, 9 months ago (2017-03-20 08:08:23 UTC) #16
haraken
On 2017/03/20 08:06:53, dcheng wrote: > https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp > File third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp (right): > > https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp#newcode126 > ...
3 years, 9 months ago (2017-03-20 11:42:36 UTC) #19
dcheng
On 2017/03/20 11:42:36, haraken wrote: > On 2017/03/20 08:06:53, dcheng wrote: > > > https://codereview.chromium.org/2760793002/diff/40001/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp ...
3 years, 9 months ago (2017-03-21 02:47:06 UTC) #20
haraken
On 2017/03/21 02:47:06, dcheng wrote: > On 2017/03/20 11:42:36, haraken wrote: > > On 2017/03/20 ...
3 years, 9 months ago (2017-03-21 02:55:20 UTC) #21
dcheng
On 2017/03/21 02:55:20, haraken wrote: > On 2017/03/21 02:47:06, dcheng wrote: > > On 2017/03/20 ...
3 years, 9 months ago (2017-03-21 04:09:02 UTC) #22
haraken
On 2017/03/21 04:09:02, dcheng wrote: > On 2017/03/21 02:55:20, haraken wrote: > > On 2017/03/21 ...
3 years, 9 months ago (2017-03-21 05:55:01 UTC) #23
dcheng
On 2017/03/21 05:55:01, haraken wrote: > On 2017/03/21 04:09:02, dcheng wrote: > > On 2017/03/21 ...
3 years, 9 months ago (2017-03-21 06:38:13 UTC) #24
Yuki
LGTM for this CL, and I support jochen's suggestion to test toString(), etc. against RemoteDOMWindow. ...
3 years, 9 months ago (2017-03-21 09:24:26 UTC) #25
dcheng
On 2017/03/21 09:24:26, Yuki wrote: > LGTM for this CL, and I support jochen's suggestion ...
3 years, 9 months ago (2017-03-21 17:45:32 UTC) #26
haraken
On 2017/03/21 17:45:32, dcheng wrote: > On 2017/03/21 09:24:26, Yuki wrote: > > LGTM for ...
3 years, 9 months ago (2017-03-22 04:32:00 UTC) #27
Yuki
On 2017/03/21 17:45:32, dcheng wrote: > The problem comes down to this: what DOMDataStore is ...
3 years, 9 months ago (2017-03-22 07:19:09 UTC) #28
dcheng
On 2017/03/22 07:19:09, Yuki wrote: > On 2017/03/21 17:45:32, dcheng wrote: > > The problem ...
3 years, 9 months ago (2017-03-22 08:10:28 UTC) #29
Yuki
On 2017/03/22 08:10:28, dcheng wrote: > On 2017/03/22 07:19:09, Yuki wrote: > > On 2017/03/21 ...
3 years, 9 months ago (2017-03-22 08:21:00 UTC) #30
dcheng
PTAL. I updated it to use the DOMDataStore even for the RemoteWindowProxy. It's not easily ...
3 years, 9 months ago (2017-03-23 01:47:09 UTC) #33
dcheng
On 2017/03/23 01:47:09, dcheng wrote: > PTAL. I updated it to use the DOMDataStore even ...
3 years, 9 months ago (2017-03-23 02:02:38 UTC) #34
Yuki
https://codereview.chromium.org/2760793002/diff/80001/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h File third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h (right): https://codereview.chromium.org/2760793002/diff/80001/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h#newcode141 third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h:141: friend class RemoteWindowProxy; I think that we don't have ...
3 years, 9 months ago (2017-03-23 02:58:30 UTC) #35
dcheng
PTAL https://codereview.chromium.org/2760793002/diff/80001/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h File third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h (right): https://codereview.chromium.org/2760793002/diff/80001/third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h#newcode141 third_party/WebKit/Source/bindings/core/v8/DOMDataStore.h:141: friend class RemoteWindowProxy; On 2017/03/23 02:58:29, Yuki wrote: ...
3 years, 9 months ago (2017-03-23 06:03:06 UTC) #40
Yuki
LGTM.
3 years, 9 months ago (2017-03-23 07:36:47 UTC) #43
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/2760793002/100001
3 years, 9 months ago (2017-03-23 18:00:39 UTC) #50
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/a94ee9eb38e2003712667dfe217a5cb1a1763dd0
3 years, 9 months ago (2017-03-23 18:22:52 UTC) #53
jochen (gone - plz use gerrit)
https://codereview.chromium.org/2760793002/diff/100001/third_party/WebKit/Source/web/tests/WebFrameTest.cpp File third_party/WebKit/Source/web/tests/WebFrameTest.cpp (right): https://codereview.chromium.org/2760793002/diff/100001/third_party/WebKit/Source/web/tests/WebFrameTest.cpp#newcode8961 third_party/WebKit/Source/web/tests/WebFrameTest.cpp:8961: WebScriptSource("try { '' + window[2]; } catch (e) { ...
3 years, 9 months ago (2017-03-23 18:27:48 UTC) #54
dcheng
3 years, 9 months ago (2017-03-23 18:31:51 UTC) #55
Message was sent while issue was closed.
https://codereview.chromium.org/2760793002/diff/100001/third_party/WebKit/Sou...
File third_party/WebKit/Source/web/tests/WebFrameTest.cpp (right):

https://codereview.chromium.org/2760793002/diff/100001/third_party/WebKit/Sou...
third_party/WebKit/Source/web/tests/WebFrameTest.cpp:8961: WebScriptSource("try
{ '' + window[2]; } catch (e) { e; }"));
On 2017/03/23 18:27:48, jochen wrote:
> Object.prototype.toString.call(window[2]) should work, no?

Hmm... that's one version I forgot to try. I'll upload a followup CL if this
makes a difference.

Powered by Google App Engine
This is Rietveld 408576698