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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.cpp

Issue 2777943005: [Bindings] Move and remove some private symbols from V8HiddenValue (Closed)
Patch Set: work for comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e2f8f06626e781570524cb78572f046703c80151..383e98ab712f994d75867833408f063aa5baf688 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,15 @@ 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();
+
+ 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.getOrEmpty(wrapper);
Yuki 2017/03/30 09:36:08 nit: We can use map = symbol.getOrUndefined(wrapp
peria 2017/03/30 10:27:12 Done.
if (map.IsEmpty()) {
- map = v8::Map::New(scriptState->isolate());
- V8HiddenValue::setHiddenValue(scriptState, wrapper, name, map);
+ map = v8::Map::New(isolate);
+ symbol.set(wrapper, map);
}
return map.As<v8::Map>();
}
@@ -61,8 +61,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 private properties in general and how the
+ // map is handled--it should never be leaked to script.
//
// 2. CustomElementRegistry does not overwrite definitions with a
// given name--see the CHECK in CustomElementRegistry::define
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698