Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp |
| index 42b80879dba746d3540b43a2d914dddfdcaec120..dddc94372326824cd7832e10ef0e09eb129a054f 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp |
| @@ -10,7 +10,6 @@ |
| #include "bindings/core/v8/V8CustomElementRegistry.h" |
| #include "bindings/core/v8/V8Element.h" |
| #include "bindings/core/v8/V8ErrorHandler.h" |
| -#include "bindings/core/v8/V8HiddenValue.h" |
| #include "bindings/core/v8/V8PrivateProperty.h" |
| #include "bindings/core/v8/V8ScriptRunner.h" |
| #include "bindings/core/v8/V8ThrowException.h" |
| @@ -30,14 +29,16 @@ static v8::Local<v8::Map> ensureCustomElementRegistryMap( |
| ScriptState* scriptState, |
| CustomElementRegistry* registry) { |
| CHECK(scriptState->world().isMainWorld()); |
| - v8::Local<v8::String> name = |
| - V8HiddenValue::customElementsRegistryMap(scriptState->isolate()); |
| + v8::Isolate* isolate = scriptState->isolate(); |
| + v8::Local<v8::Context> context = isolate->GetCurrentContext(); |
| + |
| + V8PrivateProperty::Symbol symbol = |
| + V8PrivateProperty::getCustomElementRegistryMap(isolate); |
| v8::Local<v8::Object> wrapper = ToV8(registry, scriptState).As<v8::Object>(); |
| - v8::Local<v8::Value> map = |
| - V8HiddenValue::getHiddenValue(scriptState, wrapper, name); |
| + v8::Local<v8::Value> map = symbol.get(context, wrapper); |
| if (map.IsEmpty()) { |
| - map = v8::Map::New(scriptState->isolate()); |
| - V8HiddenValue::setHiddenValue(scriptState, wrapper, name, map); |
| + map = v8::Map::New(isolate); |
| + symbol.set(context, wrapper, map); |
| } |
| return map.As<v8::Map>(); |
| } |
| @@ -61,8 +62,8 @@ ScriptCustomElementDefinition* ScriptCustomElementDefinition::forConstructor( |
| // things: |
| // |
| // 1. Only ScriptCustomElementDefinition adds entries to the map. |
| - // Audit the use of V8HiddenValue/hidden values in general and |
| - // how the map is handled--it should never be leaked to script. |
| + // Audit the use of hidden values in general and how the map is |
|
Yuki
2017/03/29 12:36:05
nit: s/hidden values/private properties/
peria
2017/03/30 09:30:16
Done.
|
| + // handled--it should never be leaked to script. |
| // |
| // 2. CustomElementRegistry does not overwrite definitions with a |
| // given name--see the CHECK in CustomElementRegistry::define |