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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 class CustomElementConstructorBuilder { | 60 class CustomElementConstructorBuilder { |
61 WTF_MAKE_NONCOPYABLE(CustomElementConstructorBuilder); | 61 WTF_MAKE_NONCOPYABLE(CustomElementConstructorBuilder); |
62 public: | 62 public: |
63 CustomElementConstructorBuilder(ScriptState*, const Dictionary* options); | 63 CustomElementConstructorBuilder(ScriptState*, const Dictionary* options); |
64 | 64 |
65 // The builder accumulates state and may run script at specific | 65 // The builder accumulates state and may run script at specific |
66 // points. These methods must be called in order. When one fails | 66 // points. These methods must be called in order. When one fails |
67 // (returns false), the calls must stop. | 67 // (returns false), the calls must stop. |
68 | 68 |
69 bool isFeatureAllowed() const; | 69 bool isFeatureAllowed() const; |
70 bool validateOptions(const AtomicString& type, ExceptionState&); | 70 bool validateOptions(const AtomicString& type, QualifiedName& tagName, Excep
tionState&); |
71 bool findTagName(const AtomicString& customElementType, QualifiedName& tagNa
me); | |
72 PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(); | 71 PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(); |
73 bool createConstructor(Document*, CustomElementDefinition*, ExceptionState&)
; | 72 bool createConstructor(Document*, CustomElementDefinition*, ExceptionState&)
; |
74 bool didRegisterDefinition(CustomElementDefinition*) const; | 73 bool didRegisterDefinition(CustomElementDefinition*) const; |
75 | 74 |
76 // This method collects a return value for the bindings. It is | 75 // This method collects a return value for the bindings. It is |
77 // safe to call this method even if the builder failed; it will | 76 // safe to call this method even if the builder failed; it will |
78 // return an empty value. | 77 // return an empty value. |
79 ScriptValue bindingsReturnValue() const; | 78 ScriptValue bindingsReturnValue() const; |
80 | 79 |
81 private: | 80 private: |
82 static WrapperTypeInfo* findWrapperType(v8::Handle<v8::Value> chain); | |
83 bool hasValidPrototypeChainFor(WrapperTypeInfo*) const; | 81 bool hasValidPrototypeChainFor(WrapperTypeInfo*) const; |
84 bool prototypeIsValid(const AtomicString& type, ExceptionState&) const; | 82 bool prototypeIsValid(const AtomicString& type, ExceptionState&) const; |
85 v8::Handle<v8::Function> retrieveCallback(v8::Isolate*, const char* name); | 83 v8::Handle<v8::Function> retrieveCallback(v8::Isolate*, const char* name); |
86 | 84 |
87 v8::Handle<v8::Context> m_context; | 85 v8::Handle<v8::Context> m_context; |
88 const Dictionary* m_options; | 86 const Dictionary* m_options; |
89 v8::Handle<v8::Object> m_prototype; | 87 v8::Handle<v8::Object> m_prototype; |
90 WrapperTypeInfo* m_wrapperType; | 88 WrapperTypeInfo* m_wrapperType; |
91 AtomicString m_namespaceURI; | |
92 v8::Handle<v8::Function> m_constructor; | 89 v8::Handle<v8::Function> m_constructor; |
93 RefPtr<V8CustomElementLifecycleCallbacks> m_callbacks; | 90 RefPtr<V8CustomElementLifecycleCallbacks> m_callbacks; |
94 }; | 91 }; |
95 | 92 |
96 } | 93 } |
97 | 94 |
98 #endif // CustomElementConstructorBuilder_h | 95 #endif // CustomElementConstructorBuilder_h |
OLD | NEW |