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