| 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 V8TestSpecialOperations_h | 7 #ifndef V8Uint8ClampedArray_h |
| 8 #define V8TestSpecialOperations_h | 8 #define V8Uint8ClampedArray_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/TestSpecialOperations.h" | 15 #include "core/dom/DOMTypedArray.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 V8TestSpecialOperations { | 20 class V8Uint8ClampedArray { |
| 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 TestUint8ClampedArray* toImpl(v8::Handle<v8::Object> object); |
| 23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 24 static TestUint8ClampedArray* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v
8::Value>); |
| 24 static TestSpecialOperations* toImpl(v8::Handle<v8::Object> object) | |
| 25 { | |
| 26 return blink::toScriptWrappableBase(object)->toImpl<TestSpecialOperation
s>(); | |
| 27 } | |
| 28 static TestSpecialOperations* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v
8::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 const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 31 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
| 36 static inline ScriptWrappableBase* toScriptWrappableBase(TestSpecialOperatio
ns* impl) | 32 static inline ScriptWrappableBase* toScriptWrappableBase(TestUint8ClampedArr
ay* impl) |
| 37 { | 33 { |
| 38 return impl->toScriptWrappableBase(); | 34 return impl->toScriptWrappableBase(); |
| 39 } | 35 } |
| 40 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8
::Isolate*) { } | 36 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8
::Isolate*) { } |
| 41 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::I
solate*) { } | 37 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::I
solate*) { } |
| 42 }; | 38 }; |
| 43 | 39 |
| 44 inline v8::Handle<v8::Object> wrap(TestSpecialOperations* impl, v8::Handle<v8::O
bject> creationContext, v8::Isolate* isolate) | 40 inline v8::Handle<v8::Object> wrap(TestUint8ClampedArray* impl, v8::Handle<v8::O
bject> creationContext, v8::Isolate* isolate) |
| 45 { | 41 { |
| 46 return impl->wrap(creationContext, isolate); | 42 return impl->wrap(creationContext, isolate); |
| 47 } | 43 } |
| 48 | 44 |
| 49 inline v8::Handle<v8::Value> toV8(TestSpecialOperations* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 45 inline v8::Handle<v8::Value> toV8(TestUint8ClampedArray* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) |
| 50 { | 46 { |
| 51 if (UNLIKELY(!impl)) | 47 if (UNLIKELY(!impl)) |
| 52 return v8::Null(isolate); | 48 return v8::Null(isolate); |
| 53 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSpecialOperat
ions>(impl, isolate); | 49 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8Uint8ClampedArray
>(impl, isolate); |
| 54 if (!wrapper.IsEmpty()) | 50 if (!wrapper.IsEmpty()) |
| 55 return wrapper; | 51 return wrapper; |
| 56 | 52 |
| 57 return impl->wrap(creationContext, isolate); | 53 return impl->wrap(creationContext, isolate); |
| 58 } | 54 } |
| 59 | 55 |
| 60 template<typename CallbackInfo> | 56 template<typename CallbackInfo> |
| 61 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSpecialOperat
ions* impl) | 57 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestUint8ClampedA
rray* impl) |
| 62 { | 58 { |
| 63 if (UNLIKELY(!impl)) { | 59 if (UNLIKELY(!impl)) { |
| 64 v8SetReturnValueNull(callbackInfo); | 60 v8SetReturnValueNull(callbackInfo); |
| 65 return; | 61 return; |
| 66 } | 62 } |
| 67 if (DOMDataStore::setReturnValueFromWrapper<V8TestSpecialOperations>(callbac
kInfo.GetReturnValue(), impl)) | 63 if (DOMDataStore::setReturnValueFromWrapper<V8Uint8ClampedArray>(callbackInf
o.GetReturnValue(), impl)) |
| 68 return; | 64 return; |
| 69 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()); |
| 70 v8SetReturnValue(callbackInfo, wrapper); | 66 v8SetReturnValue(callbackInfo, wrapper); |
| 71 } | 67 } |
| 72 | 68 |
| 73 template<typename CallbackInfo> | 69 template<typename CallbackInfo> |
| 74 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestS
pecialOperations* impl) | 70 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestU
int8ClampedArray* impl) |
| 75 { | 71 { |
| 76 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); | 72 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); |
| 77 if (UNLIKELY(!impl)) { | 73 if (UNLIKELY(!impl)) { |
| 78 v8SetReturnValueNull(callbackInfo); | 74 v8SetReturnValueNull(callbackInfo); |
| 79 return; | 75 return; |
| 80 } | 76 } |
| 81 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSpecialOperati
ons>(callbackInfo.GetReturnValue(), impl)) | 77 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8Uint8ClampedArray>
(callbackInfo.GetReturnValue(), impl)) |
| 82 return; | 78 return; |
| 83 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()); |
| 84 v8SetReturnValue(callbackInfo, wrapper); | 80 v8SetReturnValue(callbackInfo, wrapper); |
| 85 } | 81 } |
| 86 | 82 |
| 87 template<class CallbackInfo, class Wrappable> | 83 template<class CallbackInfo, class Wrappable> |
| 88 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSpecialOp
erations* impl, Wrappable* wrappable) | 84 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestUint8Clam
pedArray* impl, Wrappable* wrappable) |
| 89 { | 85 { |
| 90 if (UNLIKELY(!impl)) { | 86 if (UNLIKELY(!impl)) { |
| 91 v8SetReturnValueNull(callbackInfo); | 87 v8SetReturnValueNull(callbackInfo); |
| 92 return; | 88 return; |
| 93 } | 89 } |
| 94 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSpecialOperations>(cal
lbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 90 if (DOMDataStore::setReturnValueFromWrapperFast<V8Uint8ClampedArray>(callbac
kInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
| 95 return; | 91 return; |
| 96 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()); |
| 97 v8SetReturnValue(callbackInfo, wrapper); | 93 v8SetReturnValue(callbackInfo, wrapper); |
| 98 } | 94 } |
| 99 | 95 |
| 100 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSpecialOperations> impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) | 96 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestUint8ClampedArray> impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) |
| 101 { | 97 { |
| 102 return toV8(impl.get(), creationContext, isolate); | 98 return toV8(impl.get(), creationContext, isolate); |
| 103 } | 99 } |
| 104 | 100 |
| 105 template<class CallbackInfo> | 101 template<class CallbackInfo> |
| 106 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSp
ecialOperations> impl) | 102 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestUi
nt8ClampedArray> impl) |
| 107 { | 103 { |
| 108 v8SetReturnValue(callbackInfo, impl.get()); | 104 v8SetReturnValue(callbackInfo, impl.get()); |
| 109 } | 105 } |
| 110 | 106 |
| 111 template<class CallbackInfo> | 107 template<class CallbackInfo> |
| 112 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestSpecialOperations> impl) | 108 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestUint8ClampedArray> impl) |
| 113 { | 109 { |
| 114 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 110 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
| 115 } | 111 } |
| 116 | 112 |
| 117 template<class CallbackInfo, class Wrappable> | 113 template<class CallbackInfo, class Wrappable> |
| 118 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stSpecialOperations> impl, Wrappable* wrappable) | 114 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stUint8ClampedArray> impl, Wrappable* wrappable) |
| 119 { | 115 { |
| 120 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 116 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
| 121 } | 117 } |
| 122 | 118 |
| 123 } // namespace blink | 119 } // namespace blink |
| 124 | 120 |
| 125 #endif // V8TestSpecialOperations_h | 121 #endif // V8Uint8ClampedArray_h |
| OLD | NEW |