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

Side by Side Diff: Source/core/dom/CustomElementRegistry.h

Issue 16708002: Simplify Custom Element constructors to be functions, not wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/CustomElementConstructor.idl ('k') | Source/core/dom/CustomElementRegistry.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef CustomElementRegistry_h 31 #ifndef CustomElementRegistry_h
32 #define CustomElementRegistry_h 32 #define CustomElementRegistry_h
33 33
34 #include "bindings/v8/ScriptValue.h"
34 #include "core/dom/ContextDestructionObserver.h" 35 #include "core/dom/ContextDestructionObserver.h"
35 #include "core/dom/CustomElementConstructor.h"
36 #include "core/dom/CustomElementUpgradeCandidateMap.h" 36 #include "core/dom/CustomElementUpgradeCandidateMap.h"
37 #include "core/dom/ExceptionCode.h" 37 #include "core/dom/ExceptionCode.h"
38 #include "core/dom/QualifiedName.h" 38 #include "core/dom/QualifiedName.h"
39 #include "wtf/HashSet.h" 39 #include "wtf/HashSet.h"
40 #include "wtf/ListHashSet.h" 40 #include "wtf/ListHashSet.h"
41 #include "wtf/PassRefPtr.h" 41 #include "wtf/PassRefPtr.h"
42 #include "wtf/RefCounted.h" 42 #include "wtf/RefCounted.h"
43 #include "wtf/RefPtr.h" 43 #include "wtf/RefPtr.h"
44 #include "wtf/Vector.h" 44 #include "wtf/Vector.h"
45 #include "wtf/text/AtomicString.h" 45 #include "wtf/text/AtomicString.h"
(...skipping 25 matching lines...) Expand all
71 public: 71 public:
72 class CallbackDeliveryScope { 72 class CallbackDeliveryScope {
73 public: 73 public:
74 CallbackDeliveryScope() { } 74 CallbackDeliveryScope() { }
75 ~CallbackDeliveryScope() { CustomElementRegistry::deliverAllLifecycleCal lbacksIfNeeded(); } 75 ~CallbackDeliveryScope() { CustomElementRegistry::deliverAllLifecycleCal lbacksIfNeeded(); }
76 }; 76 };
77 77
78 explicit CustomElementRegistry(Document*); 78 explicit CustomElementRegistry(Document*);
79 ~CustomElementRegistry(); 79 ~CustomElementRegistry();
80 80
81 PassRefPtr<CustomElementConstructor> registerElement(ScriptState*, const Ato micString& name, const Dictionary& options, ExceptionCode&); 81 ScriptValue registerElement(ScriptState*, const AtomicString& name, const Di ctionary& options, ExceptionCode&);
82 82
83 bool isUnresolved(Element*) const; 83 bool isUnresolved(Element*) const;
84 PassRefPtr<CustomElementDefinition> findFor(Element*) const; 84 PassRefPtr<CustomElementDefinition> findFor(Element*) const;
85 PassRefPtr<CustomElementDefinition> findAndCheckNamespace(const AtomicString & type, const AtomicString& namespaceURI) const; 85 PassRefPtr<CustomElementDefinition> findAndCheckNamespace(const AtomicString & type, const AtomicString& namespaceURI) const;
86 86
87 PassRefPtr<Element> createCustomTagElement(const QualifiedName& localName); 87 PassRefPtr<Element> createCustomTagElement(const QualifiedName& localName);
88 88
89 Document* document() const; 89 Document* document() const;
90 90
91 void didGiveTypeExtension(Element*, const AtomicString&); 91 void didGiveTypeExtension(Element*, const AtomicString&);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 inline CustomElementRegistry::InstanceSet& CustomElementRegistry::activeCustomEl ementRegistries() 126 inline CustomElementRegistry::InstanceSet& CustomElementRegistry::activeCustomEl ementRegistries()
127 { 127 {
128 DEFINE_STATIC_LOCAL(InstanceSet, activeInstances, ()); 128 DEFINE_STATIC_LOCAL(InstanceSet, activeInstances, ());
129 return activeInstances; 129 return activeInstances;
130 } 130 }
131 131
132 132
133 } // namespace WebCore 133 } // namespace WebCore
134 134
135 #endif 135 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/CustomElementConstructor.idl ('k') | Source/core/dom/CustomElementRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698