Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| index 1f7d79ad77138ed6a703d0afcebaaea6af7ebb0f..9227686b3b291001b7399a63f7173b16d92af28e 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp |
| @@ -29,6 +29,7 @@ |
| #include "bindings/core/v8/V8DOMConfiguration.h" |
| #include "bindings/core/v8/GeneratedCodeHelper.h" // just for DCHECK |
| +#include "bindings/core/v8/ScriptState.h" |
| #include "bindings/core/v8/V8ObjectConstructor.h" |
| #include "bindings/core/v8/V8PerContextData.h" |
| #include "platform/tracing/TraceEvent.h" |
| @@ -78,11 +79,13 @@ void installAttributeInternal( |
| } |
| void installAttributeInternal( |
| - v8::Isolate* isolate, |
| + const ScriptState* scriptState, |
| v8::Local<v8::Object> instance, |
|
Yuki
2016/11/01 11:37:54
Shall we change the function name and argument nam
iclelland
2016/11/01 17:06:27
I have no problem renaming, or even restructuring
|
| v8::Local<v8::Object> prototype, |
| - const V8DOMConfiguration::AttributeConfiguration& attribute, |
| - const DOMWrapperWorld& world) { |
| + const V8DOMConfiguration::AttributeConfiguration& attribute) { |
| + v8::Isolate* isolate = scriptState->isolate(); |
| + const DOMWrapperWorld& world = scriptState->world(); |
| + |
| if (attribute.exposeConfiguration == |
| V8DOMConfiguration::OnlyExposedToPrivateScript && |
| !world.isPrivateScriptIsolatedWorld()) |
|
Yuki
2016/11/01 11:37:54
Given that this function is so special, do you nee
iclelland
2016/11/01 17:06:27
Not for origin trials. Again, this method was writ
|
| @@ -98,7 +101,7 @@ void installAttributeInternal( |
| DCHECK_EQ(&v8ConstructorAttributeGetter, attribute.getter); |
| V8PerContextData* perContextData = |
| - V8PerContextData::from(isolate->GetCurrentContext()); |
| + V8PerContextData::from(scriptState->context()); |
| v8::Local<v8::Function> data = |
|
Yuki
2016/11/01 11:37:54
nit: s/data/value/ since this is used the value of
iclelland
2016/11/02 13:49:37
Sure, done. Should this also be the case for insta
Yuki
2016/11/04 08:12:31
No. Data property setting on V8 takes a pair of (
|
| perContextData->constructorForType(attribute.data); |
| @@ -106,13 +109,13 @@ void installAttributeInternal( |
| if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInstance) |
| instance |
| ->DefineOwnProperty( |
| - isolate->GetCurrentContext(), name, data, |
| + scriptState->context(), name, data, |
|
Yuki
2016/11/01 11:37:54
The context here must always be the current contex
iclelland
2016/11/01 17:06:27
I mentioned this in another comment as well; I ran
haraken
2016/11/02 02:35:45
As shiino-san mentioned, scriptState->context() ==
iclelland
2016/11/02 13:49:37
Thanks for your patience. I've reverted this to is
Yuki
2016/11/04 08:12:31
Yes, it's correct to use scriptState->context() to
|
| static_cast<v8::PropertyAttribute>(attribute.attribute)) |
| .ToChecked(); |
| if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnPrototype) |
| prototype |
| ->DefineOwnProperty( |
| - isolate->GetCurrentContext(), name, data, |
| + scriptState->context(), name, data, |
|
Yuki
2016/11/01 11:37:54
ditto.
iclelland
2016/11/02 13:49:37
Done.
|
| static_cast<v8::PropertyAttribute>(attribute.attribute)) |
| .ToChecked(); |
| if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInterface) |
| @@ -415,12 +418,11 @@ void V8DOMConfiguration::installAttribute( |
| } |
| void V8DOMConfiguration::installAttribute( |
| - v8::Isolate* isolate, |
| - const DOMWrapperWorld& world, |
| + const ScriptState* scriptState, |
| v8::Local<v8::Object> instance, |
| v8::Local<v8::Object> prototype, |
| const AttributeConfiguration& attribute) { |
| - installAttributeInternal(isolate, instance, prototype, attribute, world); |
| + installAttributeInternal(scriptState, instance, prototype, attribute); |
| } |
| void V8DOMConfiguration::installAccessors( |