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

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

Issue 2770043003: Refactor V8PrivateProperty to use an array.
Patch Set: move the DCHECK before the indexing 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 | « third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp
index 865447da06afd6001c032b795ed6746876c2bc32..74eaedacf67b707f39ea4f1829e9963e995d788a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.cpp
@@ -11,6 +11,18 @@
namespace blink {
+void V8PrivateProperty::initialize(v8::Isolate* isolate, SymbolID symbolID) {
+ static const char* const kSymbolNames[] = {
+#define PRIVATE_PROPERTY_STRING(InterfaceName, PrivateKeyName) \
+ V8_PRIVATE_PROPERTY_SYMBOL_STRING(InterfaceName, PrivateKeyName),
+ V8_PRIVATE_PROPERTY_FOR_EACH(PRIVATE_PROPERTY_STRING)
+#undef PRIVATE_PROPERTY_STRING
+ };
+ const char* symbolName = kSymbolNames[symbolID];
+ m_symbols[symbolID].Set(
+ isolate, createV8Private(isolate, symbolName, strlen(symbolName)));
+}
+
v8::Local<v8::Value> V8PrivateProperty::Symbol::getFromMainWorld(
ScriptState* scriptState,
ScriptWrappable* scriptWrappable) {
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8PrivateProperty.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698