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

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

Issue 2048343002: Introduce CustomElementRegistry#whenDefined() method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-10T19:03:11 Created 4 years, 6 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 f98bf839145a38dff95bfe074337573d37e8fec6..e5b58b4a9287c5665fa756be7cbabcc950dbc777 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
@@ -6,6 +6,7 @@
#define CustomElementsRegistry_h
#include "base/gtest_prod_util.h"
+#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
@@ -23,6 +24,7 @@ class Document;
class Element;
class ElementRegistrationOptions;
class ExceptionState;
+class ScriptPromiseResolver;
class ScriptState;
class ScriptValue;
class V0CustomElementRegistrationContext;
@@ -57,6 +59,10 @@ public:
// TODO(dominicc): Consider broadening this API when type extensions are
// implemented.
void addCandidate(Element*);
+ ScriptPromise whenDefined(
+ ScriptState*,
+ const AtomicString& name,
+ ExceptionState&);
DECLARE_TRACE();
@@ -86,6 +92,10 @@ private:
AtomicString,
Member<UpgradeCandidateSet>>;
Member<UpgradeCandidateMap> m_upgradeCandidates;
+
+ using WhenDefinedPromiseMap =
+ HeapHashMap<AtomicString, Member<ScriptPromiseResolver>>;
+ WhenDefinedPromiseMap m_whenDefinedPromiseMap;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698