| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 10 matching lines...) Expand all Loading... |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef SKY_ENGINE_BINDINGS_CORE_V8_CUSTOMELEMENTWRAPPER_H_ | 31 #ifndef DartCustomElementWrapper_h |
| 32 #define SKY_ENGINE_BINDINGS_CORE_V8_CUSTOMELEMENTWRAPPER_H_ | 32 #define DartCustomElementWrapper_h |
| 33 | 33 |
| 34 #include "sky/engine/wtf/PassRefPtr.h" | 34 #include "bindings/core/dart/DartDOMData.h" |
| 35 #include "v8/include/v8.h" | 35 #include "wtf/PassRefPtr.h" |
| 36 #include <dart_api.h> |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 class HTMLElement; | 40 class HTMLElement; |
| 41 class SVGElement; |
| 40 | 42 |
| 41 template<typename ElementType, typename WrapperType> | 43 template<typename ElementType> |
| 42 class CustomElementWrapper { | 44 class DartCustomElementWrapper { |
| 45 public: |
| 46 static Dart_Handle upgradeDartWrapper(ElementType*, Dart_Handle (*createSpec
ificWrapper)(DartDOMData*, ElementType*)); |
| 47 |
| 48 static Dart_Handle changeElementWrapper(Dart_Handle element, Dart_Handle wra
pperType); |
| 49 |
| 50 static void initializeCustomElement(Dart_Handle wrapper, Dart_Handle& except
ion); |
| 51 |
| 43 private: | 52 private: |
| 44 CustomElementWrapper(); | 53 DartCustomElementWrapper(); |
| 45 | 54 |
| 46 friend v8::Handle<v8::Object> createV8HTMLWrapper(HTMLElement*, v8::Handle<v
8::Object>, v8::Isolate*); | 55 friend Dart_Handle createDartHTMLWrapper(DartDOMData*, HTMLElement*); |
| 56 friend Dart_Handle createDartSVGWrapper(DartDOMData*, SVGElement*); |
| 47 | 57 |
| 48 static v8::Handle<v8::Object> wrap(PassRefPtr<ElementType>, v8::Handle<v8::O
bject> creationContext, v8::Isolate*, v8::Handle<v8::Object> (*createSpecificWra
pper)(ElementType* element, v8::Handle<v8::Object> creationContext, v8::Isolate*
)); | 58 static Dart_Handle swapElementWrapper(DartDOMData*, ElementType*, Dart_Handl
e wrapperType, intptr_t nativeClassId); |
| 59 |
| 60 static Dart_Handle wrap(PassRefPtr<ElementType>, Dart_Handle (*createSpecifi
cWrapper)(DartDOMData*, ElementType*)); |
| 49 }; | 61 }; |
| 50 | 62 |
| 51 } // namespace blink | 63 } // namespace blink |
| 52 | 64 |
| 53 #endif // SKY_ENGINE_BINDINGS_CORE_V8_CUSTOMELEMENTWRAPPER_H_ | 65 #endif // CustomElementWrapper_h |
| OLD | NEW |