| 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 2d78fdf14ae2c61e98158f65c52d807b868eeef2..cebf00277a0743b3ac587c2ef2efa1d7eb51054f 100644
|
| --- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
|
| +++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.h
|
| @@ -5,34 +5,62 @@
|
| #ifndef CustomElementsRegistry_h
|
| #define CustomElementsRegistry_h
|
|
|
| +#include "bindings/core/v8/ScopedPersistent.h"
|
| #include "bindings/core/v8/ScriptWrappable.h"
|
| #include "core/CoreExport.h"
|
| +#include "platform/heap/Handle.h"
|
| +#include "v8.h"
|
| +#include "wtf/HashSet.h"
|
| +#include "wtf/text/AtomicString.h"
|
| +#include "wtf/text/AtomicStringHash.h"
|
|
|
| namespace blink {
|
|
|
| +class CustomElementDefinition;
|
| class ElementRegistrationOptions;
|
| class ExceptionState;
|
| class ScriptState;
|
| class ScriptValue;
|
|
|
| class CORE_EXPORT CustomElementsRegistry final
|
| - : public GarbageCollected<CustomElementsRegistry>
|
| + : public GarbageCollectedFinalized<CustomElementsRegistry>
|
| , public ScriptWrappable {
|
| DEFINE_WRAPPERTYPEINFO();
|
| public:
|
| - static CustomElementsRegistry* create()
|
| - {
|
| - return new CustomElementsRegistry();
|
| - }
|
| + static CustomElementsRegistry* create(ScriptState*);
|
|
|
| - void define(ScriptState*, const AtomicString& name,
|
| - const ScriptValue& constructor, const ElementRegistrationOptions&,
|
| + void define(
|
| + ScriptState*,
|
| + const AtomicString& name,
|
| + const ScriptValue& constructor,
|
| + const ElementRegistrationOptions&,
|
| ExceptionState&);
|
|
|
| + CustomElementDefinition* definitionForConstructor(
|
| + ScriptState*,
|
| + v8::Handle<v8::Value>);
|
| +
|
| + // TODO(dominicc): Remove this when V0CustomElements are removed.
|
| + bool nameIsDefined(const AtomicString&) const;
|
| +
|
| + void setWrapperReferences(
|
| + v8::Isolate*,
|
| + const v8::Persistent<v8::Object>& wrapper) const;
|
| +
|
| DECLARE_TRACE();
|
|
|
| private:
|
| - CustomElementsRegistry();
|
| + CustomElementsRegistry(v8::Isolate*);
|
| +
|
| + // This maps Custom Element constructors to an index in the list
|
| + // of defined elements. This handle is weak so it does not keep
|
| + // the constructor alive indefinitely; however the map is kept
|
| + // alive by the CustomElementsRegistry wrapper using
|
| + // visitDOMWrapper.
|
| + ScopedPersistent<v8::Map> m_constructorIdMap;
|
| +
|
| + HeapVector<Member<CustomElementDefinition>> m_definitions;
|
| + HashSet<AtomicString> m_names;
|
| };
|
|
|
| } // namespace blink
|
|
|