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

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

Issue 2828643002: Make customElements.define faster
Patch Set: Remove some unneeded casts. Created 3 years, 8 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/CustomElementDefinition.h
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
index 44d29c0cf7f8a38eb40832d4bf54e73822a810fc..9db7a76dd22a8ef47847bfb07346da655cab4eca 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
@@ -6,6 +6,7 @@
#define CustomElementDefinition_h
#include "bindings/core/v8/ScriptValue.h"
+#include "bindings/core/v8/ScriptWrappable.h" // For TraceWrapperBase
haraken 2017/04/28 08:49:30 We normally don't add this kind of comment.
#include "core/CoreExport.h"
#include "core/dom/custom/CustomElementDescriptor.h"
#include "platform/heap/Handle.h"
@@ -23,25 +24,25 @@ class HTMLElement;
class QualifiedName;
class CORE_EXPORT CustomElementDefinition
- : public GarbageCollectedFinalized<CustomElementDefinition> {
+ : public GarbageCollectedFinalized<CustomElementDefinition>,
+ public TraceWrapperBase {
WTF_MAKE_NONCOPYABLE(CustomElementDefinition);
public:
+ // Each definition has an ID that is unique within the
+ // CustomElementRegistry that created it.
+ using Id = uint32_t;
+
CustomElementDefinition(const CustomElementDescriptor&);
CustomElementDefinition(const CustomElementDescriptor&,
- const HashSet<AtomicString>&);
+ HashSet<AtomicString>&&);
virtual ~CustomElementDefinition();
DECLARE_VIRTUAL_TRACE();
+ DECLARE_VIRTUAL_TRACE_WRAPPERS() {}
const CustomElementDescriptor& Descriptor() { return descriptor_; }
- // TODO(yosin): To support Web Modules, introduce an abstract
- // class |CustomElementConstructor| to allow us to have JavaScript
- // and C++ constructors and ask the binding layer to convert
- // |CustomElementConstructor| to |ScriptValue|. Replace
- // |getConstructorForScript()| by |getConstructor() ->
- // CustomElementConstructor|.
virtual ScriptValue GetConstructorForScript() = 0;
using ConstructionStack = HeapVector<Member<Element>, 1>;

Powered by Google App Engine
This is Rietveld 408576698