| 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 12 matching lines...) Expand all  Loading... | 
| 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 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 
| 32 | 32 | 
| 33 #ifndef V8TestCustomWrapInterface_h | 33 #ifndef V8TestCustomToV8Interface_h | 
| 34 #define V8TestCustomWrapInterface_h | 34 #define V8TestCustomToV8Interface_h | 
| 35 | 35 | 
| 36 #include "bindings/tests/idls/TestCustomWrapInterface.h" | 36 #include "bindings/tests/idls/TestCustomToV8Interface.h" | 
| 37 #include "bindings/v8/V8Binding.h" | 37 #include "bindings/v8/V8Binding.h" | 
| 38 #include "bindings/v8/V8DOMWrapper.h" | 38 #include "bindings/v8/V8DOMWrapper.h" | 
| 39 #include "bindings/v8/WrapperTypeInfo.h" | 39 #include "bindings/v8/WrapperTypeInfo.h" | 
| 40 | 40 | 
| 41 namespace WebCore { | 41 namespace WebCore { | 
| 42 | 42 | 
| 43 class V8TestCustomWrapInterface { | 43 class V8TestCustomToV8Interface { | 
| 44 public: | 44 public: | 
| 45     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
     e); | 45     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
     e); | 
| 46     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 46     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 
| 47     static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
     ldType); | 47     static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
     ldType); | 
| 48     static TestCustomWrapInterface* toNative(v8::Handle<v8::Object> object) | 48     static TestCustomToV8Interface* toNative(v8::Handle<v8::Object> object) | 
| 49     { | 49     { | 
| 50         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
     DOMWrapperObjectIndex)); | 50         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
     DOMWrapperObjectIndex)); | 
| 51     } | 51     } | 
| 52     static void derefObject(void*); | 52     static void derefObject(void*); | 
| 53     static const WrapperTypeInfo wrapperTypeInfo; | 53     static const WrapperTypeInfo wrapperTypeInfo; | 
| 54     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
     ; | 54     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
     ; | 
| 55     static inline void* toInternalPointer(TestCustomWrapInterface* impl) | 55     static inline void* toInternalPointer(TestCustomToV8Interface* impl) | 
| 56     { | 56     { | 
| 57         return impl; | 57         return impl; | 
| 58     } | 58     } | 
| 59 | 59 | 
| 60     static inline TestCustomWrapInterface* fromInternalPointer(void* object) | 60     static inline TestCustomToV8Interface* fromInternalPointer(void* object) | 
| 61     { | 61     { | 
| 62         return static_cast<TestCustomWrapInterface*>(object); | 62         return static_cast<TestCustomToV8Interface*>(object); | 
| 63     } | 63     } | 
| 64     static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestC
     ustomWrapInterface*, v8::Isolate*) { } | 64     static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestC
     ustomToV8Interface*, v8::Isolate*) { } | 
| 65     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
     ate*) { } | 65     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
     ate*) { } | 
| 66 | 66 | 
| 67 private: | 67 private: | 
| 68     friend v8::Handle<v8::Object> wrap(TestCustomWrapInterface*, v8::Handle<v8::
     Object> creationContext, v8::Isolate*); |  | 
| 69     static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestCustomWrapInterfa
     ce>, v8::Handle<v8::Object> creationContext, v8::Isolate*); |  | 
| 70 }; | 68 }; | 
| 71 | 69 | 
| 72 template<> | 70 template<> | 
| 73 class WrapperTypeTraits<TestCustomWrapInterface > { | 71 class WrapperTypeTraits<TestCustomToV8Interface > { | 
| 74 public: | 72 public: | 
| 75     static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestCustomWrapIn
     terface::wrapperTypeInfo; } | 73     static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestCustomToV8In
     terface::wrapperTypeInfo; } | 
| 76 }; | 74 }; | 
| 77 | 75 | 
| 78 v8::Handle<v8::Object> wrap(TestCustomWrapInterface* impl, v8::Handle<v8::Object
     > creationContext, v8::Isolate*); | 76 class TestCustomToV8Interface; | 
|  | 77 v8::Handle<v8::Value> toV8(TestCustomToV8Interface*, v8::Handle<v8::Object> crea
     tionContext, v8::Isolate*); | 
| 79 | 78 | 
| 80 inline v8::Handle<v8::Value> toV8(TestCustomWrapInterface* impl, v8::Handle<v8::
     Object> creationContext, v8::Isolate* isolate) | 79 template<class CallbackInfo> | 
|  | 80 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestCustomToV8Int
     erface* impl) | 
| 81 { | 81 { | 
| 82     if (UNLIKELY(!impl)) | 82     v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
     o.GetIsolate())); | 
| 83         return v8NullWithCheck(isolate); |  | 
| 84     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestCustomWrapInt
     erface>(impl, isolate); |  | 
| 85     if (!wrapper.IsEmpty()) |  | 
| 86         return wrapper; |  | 
| 87     return wrap(impl, creationContext, isolate); |  | 
| 88 } | 83 } | 
| 89 | 84 | 
| 90 template<typename CallbackInfo> | 85 template<class CallbackInfo> | 
| 91 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestCustomWrapInt
     erface* impl) | 86 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestC
     ustomToV8Interface* impl) | 
| 92 { | 87 { | 
| 93     if (UNLIKELY(!impl)) { | 88      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn
     fo.GetIsolate())); | 
| 94         v8SetReturnValueNull(callbackInfo); |  | 
| 95         return; |  | 
| 96     } |  | 
| 97     if (DOMDataStore::setReturnValueFromWrapper<V8TestCustomWrapInterface>(callb
     ackInfo.GetReturnValue(), impl)) |  | 
| 98         return; |  | 
| 99     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
     nfo.GetIsolate()); |  | 
| 100     v8SetReturnValue(callbackInfo, wrapper); |  | 
| 101 } |  | 
| 102 |  | 
| 103 template<typename CallbackInfo> |  | 
| 104 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestC
     ustomWrapInterface* impl) |  | 
| 105 { |  | 
| 106     ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |  | 
| 107     if (UNLIKELY(!impl)) { |  | 
| 108         v8SetReturnValueNull(callbackInfo); |  | 
| 109         return; |  | 
| 110     } |  | 
| 111     if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestCustomWrapInte
     rface>(callbackInfo.GetReturnValue(), impl)) |  | 
| 112         return; |  | 
| 113     v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
     fo.GetIsolate()); |  | 
| 114     v8SetReturnValue(callbackInfo, wrapper); |  | 
| 115 } | 89 } | 
| 116 | 90 | 
| 117 template<class CallbackInfo, class Wrappable> | 91 template<class CallbackInfo, class Wrappable> | 
| 118 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestCustomWra
     pInterface* impl, Wrappable* wrappable) | 92 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestCustomToV
     8Interface* impl, Wrappable*) | 
| 119 { | 93 { | 
| 120     if (UNLIKELY(!impl)) { | 94      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackIn
     fo.GetIsolate())); | 
| 121         v8SetReturnValueNull(callbackInfo); |  | 
| 122         return; |  | 
| 123     } |  | 
| 124     if (DOMDataStore::setReturnValueFromWrapperFast<V8TestCustomWrapInterface>(c
     allbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |  | 
| 125         return; |  | 
| 126     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
     nfo.GetIsolate()); |  | 
| 127     v8SetReturnValue(callbackInfo, wrapper); |  | 
| 128 } | 95 } | 
| 129 | 96 | 
| 130 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestCustomWrapInterface > impl, v8:
     :Handle<v8::Object> creationContext, v8::Isolate* isolate) | 97 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestCustomToV8Interface > impl, v8:
     :Handle<v8::Object> creationContext, v8::Isolate* isolate) | 
| 131 { | 98 { | 
| 132     return toV8(impl.get(), creationContext, isolate); | 99     return toV8(impl.get(), creationContext, isolate); | 
| 133 } | 100 } | 
| 134 | 101 | 
| 135 template<class CallbackInfo> | 102 template<class CallbackInfo> | 
| 136 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestCu
     stomWrapInterface > impl) | 103 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestCu
     stomToV8Interface > impl) | 
| 137 { | 104 { | 
| 138     v8SetReturnValue(callbackInfo, impl.get()); | 105     v8SetReturnValue(callbackInfo, impl.get()); | 
| 139 } | 106 } | 
| 140 | 107 | 
| 141 template<class CallbackInfo> | 108 template<class CallbackInfo> | 
| 142 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
     efPtr<TestCustomWrapInterface > impl) | 109 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
     efPtr<TestCustomToV8Interface > impl) | 
| 143 { | 110 { | 
| 144     v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 111     v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 
| 145 } | 112 } | 
| 146 | 113 | 
| 147 template<class CallbackInfo, class Wrappable> | 114 template<class CallbackInfo, class Wrappable> | 
| 148 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
     stCustomWrapInterface > impl, Wrappable* wrappable) | 115 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
     stCustomToV8Interface > impl, Wrappable* wrappable) | 
| 149 { | 116 { | 
| 150     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 117     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 
| 151 } | 118 } | 
| 152 | 119 | 
| 153 } | 120 } | 
| 154 #endif // V8TestCustomWrapInterface_h | 121 #endif // V8TestCustomToV8Interface_h | 
| OLD | NEW | 
|---|