| Index: sky/engine/bindings-dart/core/dart/DartCustomElementConstructorBuilder.h
|
| diff --git a/sky/engine/bindings/core/v8/CustomElementConstructorBuilder.h b/sky/engine/bindings-dart/core/dart/DartCustomElementConstructorBuilder.h
|
| similarity index 57%
|
| copy from sky/engine/bindings/core/v8/CustomElementConstructorBuilder.h
|
| copy to sky/engine/bindings-dart/core/dart/DartCustomElementConstructorBuilder.h
|
| index 4faf2adda3ec5b31f5cdca63351536acbdc5c78b..de1dddc48e365a16203d9f907bf941a67626c393 100644
|
| --- a/sky/engine/bindings/core/v8/CustomElementConstructorBuilder.h
|
| +++ b/sky/engine/bindings-dart/core/dart/DartCustomElementConstructorBuilder.h
|
| @@ -28,66 +28,61 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef SKY_ENGINE_BINDINGS_CORE_V8_CUSTOMELEMENTCONSTRUCTORBUILDER_H_
|
| -#define SKY_ENGINE_BINDINGS_CORE_V8_CUSTOMELEMENTCONSTRUCTORBUILDER_H_
|
| +#ifndef DartCustomElementConstructorBuilder_h
|
| +#define DartCustomElementConstructorBuilder_h
|
|
|
| -#include "sky/engine/bindings/core/v8/ScriptValue.h"
|
| -#include "sky/engine/bindings/core/v8/V8CustomElementLifecycleCallbacks.h"
|
| -#include "sky/engine/core/dom/QualifiedName.h"
|
| -#include "sky/engine/core/dom/custom/CustomElementLifecycleCallbacks.h"
|
| -#include "sky/engine/wtf/Noncopyable.h"
|
| -#include "sky/engine/wtf/PassRefPtr.h"
|
| -#include "sky/engine/wtf/RefPtr.h"
|
| -#include "sky/engine/wtf/text/AtomicString.h"
|
| -#include "v8/include/v8.h"
|
| +#include "bindings/core/v8/CustomElementConstructorBuilder.h"
|
| +
|
| +#include <dart_api.h>
|
| +#include <v8.h>
|
|
|
| namespace blink {
|
|
|
| class CustomElementDefinition;
|
| +class DartCustomElementLifecycleCallbacks;
|
| class Dictionary;
|
| class Document;
|
| -class Element;
|
| class ExceptionState;
|
| class QualifiedName;
|
| -class V8PerContextData;
|
| -struct WrapperTypeInfo;
|
| +class ScriptState;
|
| +
|
|
|
| // 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, DartScriptState*, 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 validateOptions(const AtomicString& type, QualifiedName& tagName, ExceptionState&);
|
| - PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks();
|
| - bool createConstructor(Document*, CustomElementDefinition*, ExceptionState&);
|
| - bool didRegisterDefinition(CustomElementDefinition*) const;
|
| + virtual bool isFeatureAllowed() const;
|
| + virtual bool validateOptions(const AtomicString& type, QualifiedName& tagName, 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:
|
| - bool hasValidPrototypeChainFor(const WrapperTypeInfo*) const;
|
| - bool prototypeIsValid(const AtomicString& type, ExceptionState&) const;
|
| - v8::Handle<v8::Function> retrieveCallback(v8::Isolate*, const char* name);
|
| -
|
| - RefPtr<ScriptState> m_scriptState;
|
| - const Dictionary* m_options;
|
| - v8::Handle<v8::Object> m_prototype;
|
| - const WrapperTypeInfo* m_wrapperType;
|
| - v8::Handle<v8::Function> m_constructor;
|
| - RefPtr<V8CustomElementLifecycleCallbacks> m_callbacks;
|
| + Dart_Handle m_customType;
|
| + intptr_t m_nativeClassId;
|
| + AtomicString m_namespaceURI;
|
| + AtomicString m_extendsTagName;
|
| + AtomicString m_localName;
|
| + RefPtr<DartScriptState> m_scriptState;
|
| + RefPtr<DartCustomElementLifecycleCallbacks> m_callbacks;
|
| };
|
|
|
| }
|
|
|
| -#endif // SKY_ENGINE_BINDINGS_CORE_V8_CUSTOMELEMENTCONSTRUCTORBUILDER_H_
|
| +#endif // DartCustomElementConstructorBuilder_h
|
|
|