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

Issue 2458183002: Eagerly install Origin Trial features on window (Closed)

Created:
4 years, 1 month ago by iclelland
Modified:
4 years, 1 month ago
Reviewers:
haraken, Yuki
CC:
chromium-reviews, blink-reviews, iclelland+watch_chromuim.org, blink-reviews-bindings_chromium.org, chasej+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Eagerly install Origin Trial features on window. This fixes an issue where origin trial features which were to be installed on Window (attributes of window as well as globally visible interface objects) would not installed if the V8 context was being reused, as happens when the frame is navigated. This also replaces the use of Isolate and DOMWrapperWorld in Origin trial methods with ScriptState, which encapsulates both of those, as well as the correct V8 context for installing origin-trial-enabled attributes. BUG=653671 Committed: https://crrev.com/8a251a4b78a1f173a03ac2f0239c8a48216eed92 Cr-Commit-Position: refs/heads/master@{#429772}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Fix WebCoreTestSupport for content_shell #

Patch Set 4 : Clean up #

Total comments: 28

Patch Set 5 : Addressing review comments #

Total comments: 2

Patch Set 6 : Use correct context and enter it before installing attributes on window #

Total comments: 4

Patch Set 7 : Check for isolated worlds; simplify context check #

Patch Set 8 : Address comments from PS#7, move ScriptState change to new CL #

Total comments: 4

Patch Set 9 : Add DCHECK #

Patch Set 10 : Rebase before commit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -10 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp View 1 2 3 4 5 6 3 chunks +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h View 1 2 3 1 chunk +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp View 1 2 3 4 5 6 2 chunks +17 lines, -0 lines 0 comments Download

Messages

Total messages: 59 (37 generated)
iclelland
Yuki, can you PTAL? Thanks! This reinstates some of the code that we had pre-M55, ...
4 years, 1 month ago (2016-10-31 04:24:29 UTC) #18
haraken
On 2016/10/31 04:24:29, iclelland wrote: > Yuki, can you PTAL? Thanks! > > This reinstates ...
4 years, 1 month ago (2016-10-31 10:26:45 UTC) #21
iclelland
On 2016/10/31 10:26:45, haraken wrote: > On 2016/10/31 04:24:29, iclelland wrote: > > Yuki, can ...
4 years, 1 month ago (2016-11-01 03:48:46 UTC) #22
haraken
Thanks for the clarification. LGTM. FWIW, peria@ is now planning to add a telemetry benchmark ...
4 years, 1 month ago (2016-11-01 06:42:41 UTC) #24
Yuki
https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode61 third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:61: void installPendingConditionalFeaturesOnWindow(const ScriptState* scriptState) { You might want to ...
4 years, 1 month ago (2016-11-01 11:37:54 UTC) #25
iclelland
https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode61 third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:61: void installPendingConditionalFeaturesOnWindow(const ScriptState* scriptState) { On 2016/11/01 11:37:54, Yuki ...
4 years, 1 month ago (2016-11-01 17:06:27 UTC) #28
haraken
https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp File third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp (right): https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp#newcode112 third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp:112: scriptState->context(), name, data, On 2016/11/01 17:06:27, iclelland wrote: > ...
4 years, 1 month ago (2016-11-02 02:35:45 UTC) #31
iclelland
On 2016/11/02 02:35:45, haraken wrote: > https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp > File third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp (right): > > https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp#newcode112 > ...
4 years, 1 month ago (2016-11-02 03:33:52 UTC) #32
haraken
On 2016/11/02 03:33:52, iclelland wrote: > On 2016/11/02 02:35:45, haraken wrote: > > > https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp ...
4 years, 1 month ago (2016-11-02 04:05:18 UTC) #33
Yuki
For scriptState things, please follow haraken's suggestion (to enter the V8 context before doing something). ...
4 years, 1 month ago (2016-11-02 09:21:07 UTC) #34
iclelland
On 2016/11/02 04:05:18, haraken wrote: > Thanks for the details! > > Can we probably ...
4 years, 1 month ago (2016-11-02 13:49:38 UTC) #35
haraken
LGTM https://codereview.chromium.org/2458183002/diff/100001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp File third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp (right): https://codereview.chromium.org/2458183002/diff/100001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp#newcode276 third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp:276: installPendingConditionalFeaturesOnWindow(m_scriptState.get()); Just help me understand: Who prevents us ...
4 years, 1 month ago (2016-11-03 14:43:07 UTC) #40
iclelland
haraken, can you take one more look? The code changes around ScriptState became unnecessary after ...
4 years, 1 month ago (2016-11-03 16:00:01 UTC) #43
haraken
LGTM https://codereview.chromium.org/2458183002/diff/140001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2458183002/diff/140001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode56 third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:56: v8::Local<v8::Function> interfaceObject) { Add DCHECK(scriptState->world()->isMainWorld()). https://codereview.chromium.org/2458183002/diff/140001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode64 third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:64: DCHECK(scriptState->perContextData()); ...
4 years, 1 month ago (2016-11-03 16:02:17 UTC) #44
iclelland
https://codereview.chromium.org/2458183002/diff/140001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): https://codereview.chromium.org/2458183002/diff/140001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode56 third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp:56: v8::Local<v8::Function> interfaceObject) { On 2016/11/03 16:02:17, haraken wrote: > ...
4 years, 1 month ago (2016-11-03 16:43:04 UTC) #46
haraken
On 2016/11/03 16:43:04, iclelland wrote: > https://codereview.chromium.org/2458183002/diff/140001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp > File third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp (right): > > https://codereview.chromium.org/2458183002/diff/140001/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp#newcode56 > ...
4 years, 1 month ago (2016-11-03 16:52:44 UTC) #47
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/2458183002/200001
4 years, 1 month ago (2016-11-03 18:29:53 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/324794)
4 years, 1 month ago (2016-11-03 22:00:43 UTC) #52
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/2458183002/200001
4 years, 1 month ago (2016-11-04 00:52:19 UTC) #54
commit-bot: I haz the power
Committed patchset #10 (id:200001)
4 years, 1 month ago (2016-11-04 02:42:42 UTC) #56
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/8a251a4b78a1f173a03ac2f0239c8a48216eed92 Cr-Commit-Position: refs/heads/master@{#429772}
4 years, 1 month ago (2016-11-04 02:45:19 UTC) #58
Yuki
4 years, 1 month ago (2016-11-04 08:12:31 UTC) #59
Message was sent while issue was closed.
LGTM.

https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp (right):

https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp:105:
v8::Local<v8::Function> data =
On 2016/11/02 13:49:37, iclelland wrote:
> On 2016/11/01 11:37:54, Yuki wrote:
> > nit: s/data/value/ since this is used the value of the property.
> 
> Sure, done. Should this also be the case for installAttributeInternal(Isolate,
> Template, Template, ...) above?

No.  Data property setting on V8 takes a pair of (key, value) and an additional
|data| field.
The above installAttributeInternal is setting the additional data field.  So, I
think it's okay to call it |data|.

But, in this function, this is the value of (key, value) pair.

https://codereview.chromium.org/2458183002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp:112:
scriptState->context(), name, data,
On 2016/11/02 13:49:37, iclelland wrote:
> On 2016/11/01 11:37:54, Yuki wrote:
> > The context here must always be the current context regardless of what
you're
> > doing.  Thus isolate->GetCurrentContext() is preferred.  I know your
> assumption
> > is scriptState->context() == isolate->GetCurrentContext(), but it's not
clear
> > just from this function definition.  So, I prefer
> isolate->GetCurrentContext().
> 
> Thanks for your patience. I've reverted this to isolate->GetCurrentContext().
To
> be clear, is it still correct to use scriptState->context) when getting
> perContextData? (a few lines above this)

Yes, it's correct to use scriptState->context() to get perContextData().

Powered by Google App Engine
This is Rietveld 408576698