| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
| 6 | 6 |
| 7 #ifndef V8TestException_h | 7 #ifndef V8TestExposedInterface_h |
| 8 #define V8TestException_h | 8 #define V8TestExposedInterface_h |
| 9 | 9 |
| 10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
| 11 #include "bindings/core/v8/V8DOMWrapper.h" | 11 #include "bindings/core/v8/V8DOMWrapper.h" |
| 12 #include "bindings/core/v8/WrapperTypeInfo.h" | 12 #include "bindings/core/v8/WrapperTypeInfo.h" |
| 13 #include "bindings/tests/idls/TestException.h" | 13 #include "bindings/tests/idls/TestExposedInterface.h" |
| 14 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 class V8TestException { | 18 class V8TestExposedInterface { |
| 19 public: | 19 public: |
| 20 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); | 20 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); |
| 21 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); | 21 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); |
| 22 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 22 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); |
| 23 static TestException* toNative(v8::Handle<v8::Object> object) | 23 static TestExposedInterface* toNative(v8::Handle<v8::Object> object) |
| 24 { | 24 { |
| 25 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 25 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
| 26 } | 26 } |
| 27 static TestException* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Val
ue>); | 27 static TestExposedInterface* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<
v8::Value>); |
| 28 static const WrapperTypeInfo wrapperTypeInfo; | 28 static const WrapperTypeInfo wrapperTypeInfo; |
| 29 static void derefObject(void*); | 29 static void derefObject(void*); |
| 30 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 30 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 31 static inline void* toInternalPointer(TestException* impl) | 31 static inline void* toInternalPointer(TestExposedInterface* impl) |
| 32 { | 32 { |
| 33 return impl; | 33 return impl; |
| 34 } | 34 } |
| 35 | 35 |
| 36 static inline TestException* fromInternalPointer(void* object) | 36 static inline TestExposedInterface* fromInternalPointer(void* object) |
| 37 { | 37 { |
| 38 return static_cast<TestException*>(object); | 38 return static_cast<TestExposedInterface*>(object); |
| 39 } | 39 } |
| 40 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestE
xception*, v8::Isolate*) { } | 40 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, Te
stExposedInterface*, v8::Isolate*); |
| 41 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 41 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::I
solate*); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 friend v8::Handle<v8::Object> wrap(TestException*, v8::Handle<v8::Object> cr
eationContext, v8::Isolate*); | 44 friend v8::Handle<v8::Object> wrap(TestExposedInterface*, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate*); |
| 45 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestException>, v8::H
andle<v8::Object> creationContext, v8::Isolate*); | 45 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestExposedInterface>
, v8::Handle<v8::Object> creationContext, v8::Isolate*); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 v8::Handle<v8::Object> wrap(TestException* impl, v8::Handle<v8::Object> creation
Context, v8::Isolate*); | 48 v8::Handle<v8::Object> wrap(TestExposedInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate*); |
| 49 | 49 |
| 50 inline v8::Handle<v8::Value> toV8(TestException* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 50 inline v8::Handle<v8::Value> toV8(TestExposedInterface* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) |
| 51 { | 51 { |
| 52 if (UNLIKELY(!impl)) | 52 if (UNLIKELY(!impl)) |
| 53 return v8::Null(isolate); | 53 return v8::Null(isolate); |
| 54 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestException>(im
pl, isolate); | 54 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestExposedInterf
ace>(impl, isolate); |
| 55 if (!wrapper.IsEmpty()) | 55 if (!wrapper.IsEmpty()) |
| 56 return wrapper; | 56 return wrapper; |
| 57 return wrap(impl, creationContext, isolate); | 57 return wrap(impl, creationContext, isolate); |
| 58 } | 58 } |
| 59 | 59 |
| 60 template<typename CallbackInfo> | 60 template<typename CallbackInfo> |
| 61 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestException* im
pl) | 61 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestExposedInterf
ace* impl) |
| 62 { | 62 { |
| 63 if (UNLIKELY(!impl)) { | 63 if (UNLIKELY(!impl)) { |
| 64 v8SetReturnValueNull(callbackInfo); | 64 v8SetReturnValueNull(callbackInfo); |
| 65 return; | 65 return; |
| 66 } | 66 } |
| 67 if (DOMDataStore::setReturnValueFromWrapper<V8TestException>(callbackInfo.Ge
tReturnValue(), impl)) | 67 if (DOMDataStore::setReturnValueFromWrapper<V8TestExposedInterface>(callback
Info.GetReturnValue(), impl)) |
| 68 return; | 68 return; |
| 69 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 69 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 70 v8SetReturnValue(callbackInfo, wrapper); | 70 v8SetReturnValue(callbackInfo, wrapper); |
| 71 } | 71 } |
| 72 | 72 |
| 73 template<typename CallbackInfo> | 73 template<typename CallbackInfo> |
| 74 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestE
xception* impl) | 74 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestE
xposedInterface* impl) |
| 75 { | 75 { |
| 76 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); | 76 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); |
| 77 if (UNLIKELY(!impl)) { | 77 if (UNLIKELY(!impl)) { |
| 78 v8SetReturnValueNull(callbackInfo); | 78 v8SetReturnValueNull(callbackInfo); |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestException>(cal
lbackInfo.GetReturnValue(), impl)) | 81 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestExposedInterfa
ce>(callbackInfo.GetReturnValue(), impl)) |
| 82 return; | 82 return; |
| 83 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 83 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
| 84 v8SetReturnValue(callbackInfo, wrapper); | 84 v8SetReturnValue(callbackInfo, wrapper); |
| 85 } | 85 } |
| 86 | 86 |
| 87 template<class CallbackInfo, class Wrappable> | 87 template<class CallbackInfo, class Wrappable> |
| 88 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestException
* impl, Wrappable* wrappable) | 88 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestExposedIn
terface* impl, Wrappable* wrappable) |
| 89 { | 89 { |
| 90 if (UNLIKELY(!impl)) { | 90 if (UNLIKELY(!impl)) { |
| 91 v8SetReturnValueNull(callbackInfo); | 91 v8SetReturnValueNull(callbackInfo); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestException>(callbackInf
o.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 94 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestExposedInterface>(call
backInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 95 return; | 95 return; |
| 96 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 96 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 97 v8SetReturnValue(callbackInfo, wrapper); | 97 v8SetReturnValue(callbackInfo, wrapper); |
| 98 } | 98 } |
| 99 | 99 |
| 100 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestException> impl, v8::Handle<v8:
:Object> creationContext, v8::Isolate* isolate) | 100 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestExposedInterface> impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) |
| 101 { | 101 { |
| 102 return toV8(impl.get(), creationContext, isolate); | 102 return toV8(impl.get(), creationContext, isolate); |
| 103 } | 103 } |
| 104 | 104 |
| 105 template<class CallbackInfo> | 105 template<class CallbackInfo> |
| 106 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestEx
ception> impl) | 106 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestEx
posedInterface> impl) |
| 107 { | 107 { |
| 108 v8SetReturnValue(callbackInfo, impl.get()); | 108 v8SetReturnValue(callbackInfo, impl.get()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 template<class CallbackInfo> | 111 template<class CallbackInfo> |
| 112 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestException> impl) | 112 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestExposedInterface> impl) |
| 113 { | 113 { |
| 114 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 114 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 template<class CallbackInfo, class Wrappable> | 117 template<class CallbackInfo, class Wrappable> |
| 118 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stException> impl, Wrappable* wrappable) | 118 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stExposedInterface> impl, Wrappable* wrappable) |
| 119 { | 119 { |
| 120 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 120 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } | 123 } |
| 124 #endif // V8TestException_h | 124 #endif // V8TestExposedInterface_h |
| OLD | NEW |