| 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 V8TestTypedefs_h | 7 #ifndef V8DataView_h |
| 8 #define V8TestTypedefs_h | 8 #define V8DataView_h |
| 9 | 9 |
| 10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
| 11 #include "bindings/core/v8/V8ArrayBufferView.h" |
| 11 #include "bindings/core/v8/V8Binding.h" | 12 #include "bindings/core/v8/V8Binding.h" |
| 12 #include "bindings/core/v8/V8DOMWrapper.h" | 13 #include "bindings/core/v8/V8DOMWrapper.h" |
| 13 #include "bindings/core/v8/WrapperTypeInfo.h" | 14 #include "bindings/core/v8/WrapperTypeInfo.h" |
| 14 #include "bindings/tests/idls/core/TestTypedefs.h" | 15 #include "bindings/tests/idls/core/TestDataView.h" |
| 15 #include "platform/heap/Handle.h" | 16 #include "platform/heap/Handle.h" |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 | 19 |
| 19 class V8TestTypedefs { | 20 class V8DataView { |
| 20 public: | 21 public: |
| 21 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); | 22 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); |
| 22 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); | 23 static TestDataView* toImpl(v8::Handle<v8::Object> object); |
| 23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 24 static TestDataView* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>
); |
| 24 static TestTypedefs* toImpl(v8::Handle<v8::Object> object) | |
| 25 { | |
| 26 return blink::toScriptWrappableBase(object)->toImpl<TestTypedefs>(); | |
| 27 } | |
| 28 static TestTypedefs* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>
); | |
| 29 static const WrapperTypeInfo wrapperTypeInfo; | 25 static const WrapperTypeInfo wrapperTypeInfo; |
| 30 static void refObject(ScriptWrappableBase* internalPointer); | 26 static void refObject(ScriptWrappableBase* internalPointer); |
| 31 static void derefObject(ScriptWrappableBase* internalPointer); | 27 static void derefObject(ScriptWrappableBase* internalPointer); |
| 32 static void trace(Visitor* visitor, ScriptWrappableBase* internalPointer) | 28 static void trace(Visitor* visitor, ScriptWrappableBase* internalPointer) |
| 33 { | 29 { |
| 34 } | 30 } |
| 35 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 36 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 31 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 37 static inline ScriptWrappableBase* toScriptWrappableBase(TestTypedefs* impl) | 32 static inline ScriptWrappableBase* toScriptWrappableBase(TestDataView* impl) |
| 38 { | 33 { |
| 39 return impl->toScriptWrappableBase(); | 34 return impl->toScriptWrappableBase(); |
| 40 } | 35 } |
| 41 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8
::Isolate*) { } | 36 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8
::Isolate*) { } |
| 42 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::I
solate*) { } | 37 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::I
solate*) { } |
| 43 }; | 38 }; |
| 44 | 39 |
| 45 inline v8::Handle<v8::Object> wrap(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 40 inline v8::Handle<v8::Object> wrap(TestDataView* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
| 46 { | 41 { |
| 47 return impl->wrap(creationContext, isolate); | 42 return impl->wrap(creationContext, isolate); |
| 48 } | 43 } |
| 49 | 44 |
| 50 inline v8::Handle<v8::Value> toV8(TestTypedefs* impl, v8::Handle<v8::Object> cre
ationContext, v8::Isolate* isolate) | 45 inline v8::Handle<v8::Value> toV8(TestDataView* impl, v8::Handle<v8::Object> cre
ationContext, v8::Isolate* isolate) |
| 51 { | 46 { |
| 52 if (UNLIKELY(!impl)) | 47 if (UNLIKELY(!impl)) |
| 53 return v8::Null(isolate); | 48 return v8::Null(isolate); |
| 54 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestTypedefs>(imp
l, isolate); | 49 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8DataView>(impl, i
solate); |
| 55 if (!wrapper.IsEmpty()) | 50 if (!wrapper.IsEmpty()) |
| 56 return wrapper; | 51 return wrapper; |
| 57 | 52 |
| 58 return impl->wrap(creationContext, isolate); | 53 return impl->wrap(creationContext, isolate); |
| 59 } | 54 } |
| 60 | 55 |
| 61 template<typename CallbackInfo> | 56 template<typename CallbackInfo> |
| 62 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestTypedefs* imp
l) | 57 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestDataView* imp
l) |
| 63 { | 58 { |
| 64 if (UNLIKELY(!impl)) { | 59 if (UNLIKELY(!impl)) { |
| 65 v8SetReturnValueNull(callbackInfo); | 60 v8SetReturnValueNull(callbackInfo); |
| 66 return; | 61 return; |
| 67 } | 62 } |
| 68 if (DOMDataStore::setReturnValueFromWrapper<V8TestTypedefs>(callbackInfo.Get
ReturnValue(), impl)) | 63 if (DOMDataStore::setReturnValueFromWrapper<V8DataView>(callbackInfo.GetRetu
rnValue(), impl)) |
| 69 return; | 64 return; |
| 70 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 65 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 71 v8SetReturnValue(callbackInfo, wrapper); | 66 v8SetReturnValue(callbackInfo, wrapper); |
| 72 } | 67 } |
| 73 | 68 |
| 74 template<typename CallbackInfo> | 69 template<typename CallbackInfo> |
| 75 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestT
ypedefs* impl) | 70 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestD
ataView* impl) |
| 76 { | 71 { |
| 77 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); | 72 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); |
| 78 if (UNLIKELY(!impl)) { | 73 if (UNLIKELY(!impl)) { |
| 79 v8SetReturnValueNull(callbackInfo); | 74 v8SetReturnValueNull(callbackInfo); |
| 80 return; | 75 return; |
| 81 } | 76 } |
| 82 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestTypedefs>(call
backInfo.GetReturnValue(), impl)) | 77 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8DataView>(callback
Info.GetReturnValue(), impl)) |
| 83 return; | 78 return; |
| 84 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 79 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
| 85 v8SetReturnValue(callbackInfo, wrapper); | 80 v8SetReturnValue(callbackInfo, wrapper); |
| 86 } | 81 } |
| 87 | 82 |
| 88 template<class CallbackInfo, class Wrappable> | 83 template<class CallbackInfo, class Wrappable> |
| 89 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestTypedefs*
impl, Wrappable* wrappable) | 84 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestDataView*
impl, Wrappable* wrappable) |
| 90 { | 85 { |
| 91 if (UNLIKELY(!impl)) { | 86 if (UNLIKELY(!impl)) { |
| 92 v8SetReturnValueNull(callbackInfo); | 87 v8SetReturnValueNull(callbackInfo); |
| 93 return; | 88 return; |
| 94 } | 89 } |
| 95 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestTypedefs>(callbackInfo
.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 90 if (DOMDataStore::setReturnValueFromWrapperFast<V8DataView>(callbackInfo.Get
ReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 96 return; | 91 return; |
| 97 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 92 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
| 98 v8SetReturnValue(callbackInfo, wrapper); | 93 v8SetReturnValue(callbackInfo, wrapper); |
| 99 } | 94 } |
| 100 | 95 |
| 101 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestTypedefs> impl, v8::Handle<v8::
Object> creationContext, v8::Isolate* isolate) | 96 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestDataView> impl, v8::Handle<v8::
Object> creationContext, v8::Isolate* isolate) |
| 102 { | 97 { |
| 103 return toV8(impl.get(), creationContext, isolate); | 98 return toV8(impl.get(), creationContext, isolate); |
| 104 } | 99 } |
| 105 | 100 |
| 106 template<class CallbackInfo> | 101 template<class CallbackInfo> |
| 107 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestTy
pedefs> impl) | 102 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestDa
taView> impl) |
| 108 { | 103 { |
| 109 v8SetReturnValue(callbackInfo, impl.get()); | 104 v8SetReturnValue(callbackInfo, impl.get()); |
| 110 } | 105 } |
| 111 | 106 |
| 112 template<class CallbackInfo> | 107 template<class CallbackInfo> |
| 113 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestTypedefs> impl) | 108 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestDataView> impl) |
| 114 { | 109 { |
| 115 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 110 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 116 } | 111 } |
| 117 | 112 |
| 118 template<class CallbackInfo, class Wrappable> | 113 template<class CallbackInfo, class Wrappable> |
| 119 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stTypedefs> impl, Wrappable* wrappable) | 114 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stDataView> impl, Wrappable* wrappable) |
| 120 { | 115 { |
| 121 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 116 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 122 } | 117 } |
| 123 | 118 |
| 124 } // namespace blink | 119 } // namespace blink |
| 125 | 120 |
| 126 #endif // V8TestTypedefs_h | 121 #endif // V8DataView_h |
| OLD | NEW |