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

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

Issue 2029923003: Recursively defining custom elements should not lead to redefinition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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 da65a760ae6833e6924a8387d10a7884487647aa..f98bf839145a38dff95bfe074337573d37e8fec6 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
@@ -9,6 +9,7 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
+#include "wtf/HashSet.h"
#include "wtf/Noncopyable.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/AtomicStringHash.h"
@@ -27,13 +28,15 @@ class ScriptValue;
class V0CustomElementRegistrationContext;
class CORE_EXPORT CustomElementsRegistry final
- : public GarbageCollected<CustomElementsRegistry>
+ : public GarbageCollectedFinalized<CustomElementsRegistry>
, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
WTF_MAKE_NONCOPYABLE(CustomElementsRegistry);
public:
static CustomElementsRegistry* create(Document*);
+ virtual ~CustomElementsRegistry() = default;
+
void define(
ScriptState*,
const AtomicString& name,
@@ -69,6 +72,9 @@ private:
const CustomElementDescriptor&,
HeapVector<Member<Element>>*);
+ class NameIsBeingDefined;
+
+ HashSet<AtomicString> m_namesBeingDefined;
using DefinitionMap =
HeapHashMap<AtomicString, Member<CustomElementDefinition>>;
DefinitionMap m_definitions;

Powered by Google App Engine
This is Rietveld 408576698