Chromium Code Reviews| Index: Source/bindings/dart/DartCustomElementConstructorBuilder.h |
| diff --git a/Source/bindings/v8/CustomElementConstructorBuilder.h b/Source/bindings/dart/DartCustomElementConstructorBuilder.h |
| similarity index 59% |
| copy from Source/bindings/v8/CustomElementConstructorBuilder.h |
| copy to Source/bindings/dart/DartCustomElementConstructorBuilder.h |
| index 84e46bb568a56a6a6f8a54d0db1bdfb48638e642..ba03b5f444d98afb8e37bbe96b97b9c202691c6b 100644 |
| --- a/Source/bindings/v8/CustomElementConstructorBuilder.h |
| +++ b/Source/bindings/dart/DartCustomElementConstructorBuilder.h |
| @@ -28,71 +28,61 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef CustomElementConstructorBuilder_h |
| -#define CustomElementConstructorBuilder_h |
| +#ifndef DartCustomElementConstructorBuilder_h |
| +#define DartCustomElementConstructorBuilder_h |
| -#include "bindings/v8/ScriptValue.h" |
| -#include "bindings/v8/V8CustomElementLifecycleCallbacks.h" |
| -#include "core/dom/CustomElementLifecycleCallbacks.h" |
| -#include "core/dom/QualifiedName.h" |
| -#include "wtf/Noncopyable.h" |
| -#include "wtf/PassRefPtr.h" |
| -#include "wtf/RefPtr.h" |
| -#include "wtf/text/AtomicString.h" |
| +#include "bindings/v8/CustomElementConstructorBuilder.h" |
| + |
| +#include <dart_api.h> |
| #include <v8.h> |
| namespace WebCore { |
| class CustomElementDefinition; |
| +class DartCustomElementLifecycleCallbacks; |
| class Dictionary; |
| class Document; |
| -class Element; |
| class ExceptionState; |
| class QualifiedName; |
| class ScriptState; |
| -class V8PerContextData; |
| -class WrapperTypeInfo; |
| + |
| // Handles the scripting-specific parts of the Custom Elements element |
| // registration algorithm and constructor generation algorithm. It is |
| // used in the implementation of those algorithms in |
| // Document::registerElement. |
| -class CustomElementConstructorBuilder { |
| - WTF_MAKE_NONCOPYABLE(CustomElementConstructorBuilder); |
| +class DartCustomElementConstructorBuilder : public CustomElementConstructorBuilder { |
| + WTF_MAKE_NONCOPYABLE(DartCustomElementConstructorBuilder); |
| public: |
| - CustomElementConstructorBuilder(ScriptState*, const Dictionary* options); |
| + DartCustomElementConstructorBuilder(Dart_Handle type, const AtomicString& extendsTagName, ScriptState*, const Dictionary* options); |
| + virtual ~DartCustomElementConstructorBuilder() { } |
| // The builder accumulates state and may run script at specific |
| // points. These methods must be called in order. When one fails |
| // (returns false), the calls must stop. |
| - bool isFeatureAllowed() const; |
| - bool validateOptions(const AtomicString& type, ExceptionState&); |
| - bool findTagName(const AtomicString& customElementType, QualifiedName& tagName); |
| - PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(); |
| - bool createConstructor(Document*, CustomElementDefinition*, ExceptionState&); |
| - bool didRegisterDefinition(CustomElementDefinition*) const; |
| + virtual bool isFeatureAllowed() const; |
| + virtual bool validateOptions(const AtomicString& type, ExceptionState&); |
| + virtual bool findTagName(const AtomicString& customElementType, QualifiedName& tagName); |
| + virtual PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(); |
| + virtual bool createConstructor(Document*, CustomElementDefinition*, ExceptionState&); |
| + virtual bool didRegisterDefinition(CustomElementDefinition*) const; |
| // This method collects a return value for the bindings. It is |
| // safe to call this method even if the builder failed; it will |
| // return an empty value. |
| - ScriptValue bindingsReturnValue() const; |
| + virtual ScriptValue bindingsReturnValue() const; |
| private: |
| - static WrapperTypeInfo* findWrapperType(v8::Handle<v8::Value> chain); |
| - bool hasValidPrototypeChainFor(V8PerContextData*, WrapperTypeInfo*) const; |
| - bool prototypeIsValid(const AtomicString& type, ExceptionState&) const; |
| - v8::Handle<v8::Function> retrieveCallback(v8::Isolate*, const char* name); |
| - |
| - v8::Handle<v8::Context> m_context; |
| - const Dictionary* m_options; |
| - v8::Handle<v8::Object> m_prototype; |
| - WrapperTypeInfo* m_wrapperType; |
| + Dart_Handle m_customType; |
|
siva
2013/09/20 20:57:37
How do we ensure that this handle will not go out
blois
2013/09/20 22:18:03
This class is only used as a stack variable from D
|
| + Dart_Isolate m_isolate; |
| AtomicString m_namespaceURI; |
| - v8::Handle<v8::Function> m_constructor; |
| - RefPtr<V8CustomElementLifecycleCallbacks> m_callbacks; |
| + AtomicString m_extendsTagName; |
| + AtomicString m_localName; |
| + v8::Handle<v8::Context> m_context; |
| + RefPtr<DartCustomElementLifecycleCallbacks> m_callbacks; |
| }; |
| } |
| -#endif // CustomElementConstructorBuilder_h |
| +#endif // DartCustomElementConstructorBuilder_h |