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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h

Issue 1994093002: Introduce CustomElementRegistry#get() method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-23T13:42:56 Created 4 years, 7 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
Index: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
index de7d2aaa98ccb722181a7683df4dfefd92421b95..b96f13a9fd9d037dff4f0d6469226b4f19217ea7 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
@@ -43,6 +43,9 @@ public:
CustomElementDefinition* definitionForConstructor(
ScriptState*,
v8::Local<v8::Value> constructor);
+
+ ScriptValue get(ScriptState*, const AtomicString& name);
+
v8::Local<v8::Object> prototype(
ScriptState*,
const CustomElementDefinition&);
@@ -56,9 +59,11 @@ private:
CustomElementsRegistry(const V0CustomElementRegistrationContext*);
// Retrieves the Map which, given a constructor, contains the id
- // of the definition; or given an id, contains the prototype.
- // Returns true if the map was retrieved; false if the map was
- // not initialized yet.
+ // of the definition; or given an id, contains v8::Array to hold
+ // JavaScript values of custom element definitions, e.g. constructor,
+ // prototype, promise for CER#whenDefined, and so on.
+ // TODO(yosin): Once traceWrapper is ready we should move JavaScript
+ // value to |CustomElementDefinition|.
v8::Local<v8::Map> idMap(ScriptState*);
bool idForConstructor(
@@ -70,7 +75,7 @@ private:
Member<const V0CustomElementRegistrationContext> m_v0;
HeapVector<Member<CustomElementDefinition>> m_definitions;
- HashSet<AtomicString> m_names;
+ HashMap<AtomicString, Id> m_names;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698