| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 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 CustomElementConstructorBuilder_h | 31 #ifndef CustomElementConstructorBuilder_h |
| 32 #define CustomElementConstructorBuilder_h | 32 #define CustomElementConstructorBuilder_h |
| 33 | 33 |
| 34 #include "bindings/v8/ScriptValue.h" | 34 #include "bindings/v8/ScriptValue.h" |
| 35 #include "core/dom/CustomElementLifecycleCallbacks.h" | 35 #include "core/dom/CustomElementLifecycleCallbacks.h" |
| 36 #include "core/dom/QualifiedName.h" | 36 #include "core/dom/QualifiedName.h" |
| 37 #include "wtf/HashSet.h" | |
| 38 #include "wtf/Noncopyable.h" | 37 #include "wtf/Noncopyable.h" |
| 39 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
| 40 #include "wtf/text/AtomicString.h" | 39 #include "wtf/text/AtomicString.h" |
| 41 #include <v8.h> | 40 #include <v8.h> |
| 42 | 41 |
| 43 namespace WebCore { | 42 namespace WebCore { |
| 44 | 43 |
| 45 class CustomElementDefinition; | 44 class CustomElementDefinition; |
| 46 class Dictionary; | 45 class Dictionary; |
| 47 class Document; | 46 class Document; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 62 | 61 |
| 63 // The builder accumulates state and may run script at specific | 62 // The builder accumulates state and may run script at specific |
| 64 // points. These methods must be called in order. When one fails | 63 // points. These methods must be called in order. When one fails |
| 65 // (returns false), the calls must stop. | 64 // (returns false), the calls must stop. |
| 66 | 65 |
| 67 bool isFeatureAllowed() const; | 66 bool isFeatureAllowed() const; |
| 68 bool validateOptions(); | 67 bool validateOptions(); |
| 69 bool findTagName(const AtomicString& customElementType, QualifiedName& tagNa
me) const; | 68 bool findTagName(const AtomicString& customElementType, QualifiedName& tagNa
me) const; |
| 70 PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(Document*); | 69 PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(Document*); |
| 71 bool createConstructor(Document*, CustomElementDefinition*); | 70 bool createConstructor(Document*, CustomElementDefinition*); |
| 72 bool didRegisterDefinition(CustomElementDefinition*, const HashSet<Element*>
& upgradeCandidates) const; | 71 bool didRegisterDefinition(CustomElementDefinition*) const; |
| 73 | 72 |
| 74 // This method collects a return value for the bindings. It is | 73 // This method collects a return value for the bindings. It is |
| 75 // safe to call this method even if the builder failed; it will | 74 // safe to call this method even if the builder failed; it will |
| 76 // return an empty value. | 75 // return an empty value. |
| 77 ScriptValue bindingsReturnValue() const; | 76 ScriptValue bindingsReturnValue() const; |
| 78 | 77 |
| 79 private: | 78 private: |
| 80 bool hasValidPrototypeChainFor(V8PerContextData*, WrapperTypeInfo*) const; | 79 bool hasValidPrototypeChainFor(V8PerContextData*, WrapperTypeInfo*) const; |
| 81 bool prototypeIsValid() const; | 80 bool prototypeIsValid() const; |
| 82 | 81 |
| 83 v8::Handle<v8::Context> m_context; | 82 v8::Handle<v8::Context> m_context; |
| 84 const Dictionary* m_options; | 83 const Dictionary* m_options; |
| 85 v8::Handle<v8::Object> m_prototype; | 84 v8::Handle<v8::Object> m_prototype; |
| 86 AtomicString m_namespaceURI; | 85 AtomicString m_namespaceURI; |
| 87 v8::Handle<v8::Function> m_constructor; | 86 v8::Handle<v8::Function> m_constructor; |
| 88 }; | 87 }; |
| 89 | 88 |
| 90 } | 89 } |
| 91 | 90 |
| 92 #endif // CustomElementConstructorBuilder_h | 91 #endif // CustomElementConstructorBuilder_h |
| OLD | NEW |