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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementTestHelpers.h

Issue 2828643002: Make customElements.define faster
Patch Set: Remove some unneeded casts. Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CustomElementTestHelpers_h 5 #ifndef CustomElementTestHelpers_h
6 #define CustomElementTestHelpers_h 6 #define CustomElementTestHelpers_h
7 7
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/Element.h" 10 #include "core/dom/Element.h"
(...skipping 17 matching lines...) Expand all
28 : public CustomElementDefinitionBuilder { 28 : public CustomElementDefinitionBuilder {
29 STACK_ALLOCATED(); 29 STACK_ALLOCATED();
30 WTF_MAKE_NONCOPYABLE(TestCustomElementDefinitionBuilder); 30 WTF_MAKE_NONCOPYABLE(TestCustomElementDefinitionBuilder);
31 31
32 public: 32 public:
33 TestCustomElementDefinitionBuilder() {} 33 TestCustomElementDefinitionBuilder() {}
34 bool CheckConstructorIntrinsics() override { return true; } 34 bool CheckConstructorIntrinsics() override { return true; }
35 bool CheckConstructorNotRegistered() override { return true; } 35 bool CheckConstructorNotRegistered() override { return true; }
36 bool CheckPrototype() override { return true; } 36 bool CheckPrototype() override { return true; }
37 bool RememberOriginalProperties() override { return true; } 37 bool RememberOriginalProperties() override { return true; }
38 CustomElementDefinition* Build(const CustomElementDescriptor&) override; 38 CustomElementDefinition* Build(const CustomElementDescriptor&,
39 CustomElementDefinition::Id) override;
39 }; 40 };
40 41
41 class TestCustomElementDefinition : public CustomElementDefinition { 42 class TestCustomElementDefinition : public CustomElementDefinition {
42 WTF_MAKE_NONCOPYABLE(TestCustomElementDefinition); 43 WTF_MAKE_NONCOPYABLE(TestCustomElementDefinition);
43 44
44 public: 45 public:
45 TestCustomElementDefinition(const CustomElementDescriptor& descriptor) 46 TestCustomElementDefinition(const CustomElementDescriptor& descriptor)
46 : CustomElementDefinition(descriptor) {} 47 : CustomElementDefinition(descriptor) {}
47 48
48 TestCustomElementDefinition(const CustomElementDescriptor& descriptor, 49 TestCustomElementDefinition(const CustomElementDescriptor& descriptor,
49 const HashSet<AtomicString>& observed_attributes) 50 HashSet<AtomicString>&& observed_attributes)
50 : CustomElementDefinition(descriptor, observed_attributes) {} 51 : CustomElementDefinition(descriptor, std::move(observed_attributes)) {}
51 52
52 ~TestCustomElementDefinition() override = default; 53 ~TestCustomElementDefinition() override = default;
53 54
54 ScriptValue GetConstructorForScript() override { return ScriptValue(); } 55 ScriptValue GetConstructorForScript() override { return ScriptValue(); }
55 56
56 bool RunConstructor(Element* element) override { 57 bool RunConstructor(Element* element) override {
57 if (GetConstructionStack().IsEmpty() || 58 if (GetConstructionStack().IsEmpty() ||
58 GetConstructionStack().back() != element) 59 GetConstructionStack().back() != element)
59 return false; 60 return false;
60 GetConstructionStack().back().Clear(); 61 GetConstructionStack().back().Clear();
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 private: 134 private:
134 Member<Document> document_; 135 Member<Document> document_;
135 AtomicString namespace_uri_; 136 AtomicString namespace_uri_;
136 AtomicString local_name_; 137 AtomicString local_name_;
137 std::vector<std::pair<QualifiedName, AtomicString>> attributes_; 138 std::vector<std::pair<QualifiedName, AtomicString>> attributes_;
138 }; 139 };
139 140
140 } // namespace blink 141 } // namespace blink
141 142
142 #endif // CustomElementTestHelpers_h 143 #endif // CustomElementTestHelpers_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698