| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // Document::registerElement. | 58 // Document::registerElement. |
| 59 class CustomElementConstructorBuilder { | 59 class CustomElementConstructorBuilder { |
| 60 WTF_MAKE_NONCOPYABLE(CustomElementConstructorBuilder); | 60 WTF_MAKE_NONCOPYABLE(CustomElementConstructorBuilder); |
| 61 public: | 61 public: |
| 62 CustomElementConstructorBuilder(ScriptState*, const Dictionary* options); | 62 CustomElementConstructorBuilder(ScriptState*, const Dictionary* options); |
| 63 | 63 |
| 64 // The builder accumulates state and may run script at specific | 64 // The builder accumulates state and may run script at specific |
| 65 // points. These methods must be called in order. When one fails | 65 // points. These methods must be called in order. When one fails |
| 66 // (returns false), the calls must stop. | 66 // (returns false), the calls must stop. |
| 67 | 67 |
| 68 bool isFeatureAllowed() const; | |
| 69 bool validateOptions(const AtomicString& type, QualifiedName& tagName, Excep
tionState&); | 68 bool validateOptions(const AtomicString& type, QualifiedName& tagName, Excep
tionState&); |
| 70 PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(); | 69 PassRefPtr<CustomElementLifecycleCallbacks> createCallbacks(); |
| 71 bool createConstructor(Document*, CustomElementDefinition*, ExceptionState&)
; | 70 bool createConstructor(Document*, CustomElementDefinition*, ExceptionState&)
; |
| 72 bool didRegisterDefinition(CustomElementDefinition*) 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(const WrapperTypeInfo*) const; | 79 bool hasValidPrototypeChainFor(const WrapperTypeInfo*) const; |
| 81 bool prototypeIsValid(const AtomicString& type, ExceptionState&) const; | 80 bool prototypeIsValid(const AtomicString& type, ExceptionState&) const; |
| 82 v8::Handle<v8::Function> retrieveCallback(v8::Isolate*, const char* name); | 81 v8::Handle<v8::Function> retrieveCallback(v8::Isolate*, const char* name); |
| 83 | 82 |
| 84 RefPtr<ScriptState> m_scriptState; | 83 RefPtr<ScriptState> m_scriptState; |
| 85 const Dictionary* m_options; | 84 const Dictionary* m_options; |
| 86 v8::Handle<v8::Object> m_prototype; | 85 v8::Handle<v8::Object> m_prototype; |
| 87 const WrapperTypeInfo* m_wrapperType; | 86 const WrapperTypeInfo* m_wrapperType; |
| 88 v8::Handle<v8::Function> m_constructor; | 87 v8::Handle<v8::Function> m_constructor; |
| 89 RefPtr<V8CustomElementLifecycleCallbacks> m_callbacks; | 88 RefPtr<V8CustomElementLifecycleCallbacks> m_callbacks; |
| 90 }; | 89 }; |
| 91 | 90 |
| 92 } | 91 } |
| 93 | 92 |
| 94 #endif // SKY_ENGINE_BINDINGS_CORE_V8_CUSTOMELEMENTCONSTRUCTORBUILDER_H_ | 93 #endif // SKY_ENGINE_BINDINGS_CORE_V8_CUSTOMELEMENTCONSTRUCTORBUILDER_H_ |
| OLD | NEW |