Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: Source/bindings/tests/results/core/V8ArrayBuffer.h

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 V8ArrayBuffer_h
8 #define V8TestException_h 8 #define V8ArrayBuffer_h
9 9
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "bindings/core/v8/V8Binding.h" 11 #include "bindings/core/v8/V8Binding.h"
12 #include "bindings/core/v8/V8DOMWrapper.h" 12 #include "bindings/core/v8/V8DOMWrapper.h"
13 #include "bindings/core/v8/WrapperTypeInfo.h" 13 #include "bindings/core/v8/WrapperTypeInfo.h"
14 #include "bindings/tests/idls/core/TestException.h" 14 #include "bindings/tests/idls/core/TestArrayBuffer.h"
15 #include "platform/heap/Handle.h" 15 #include "platform/heap/Handle.h"
16 16
17 namespace blink { 17 namespace blink {
18 18
19 class V8TestException { 19 class V8ArrayBuffer {
20 public: 20 public:
21 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); 21 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
22 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va lue>, v8::Isolate*); 22 static TestArrayBuffer* toImpl(v8::Handle<v8::Object> object);
23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); 23 static TestArrayBuffer* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Val ue>);
24 static TestException* toImpl(v8::Handle<v8::Object> object)
25 {
26 return blink::toScriptWrappableBase(object)->toImpl<TestException>();
27 }
28 static TestException* toImplWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value >);
29 static const WrapperTypeInfo wrapperTypeInfo; 24 static const WrapperTypeInfo wrapperTypeInfo;
30 static void refObject(ScriptWrappableBase* internalPointer); 25 static void refObject(ScriptWrappableBase* internalPointer);
31 static void derefObject(ScriptWrappableBase* internalPointer); 26 static void derefObject(ScriptWrappableBase* internalPointer);
32 static void trace(Visitor* visitor, ScriptWrappableBase* internalPointer) 27 static void trace(Visitor* visitor, ScriptWrappableBase* internalPointer)
33 { 28 {
34 } 29 }
35 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ; 30 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 ;
36 static inline ScriptWrappableBase* toScriptWrappableBase(TestException* impl ) 31 static inline ScriptWrappableBase* toScriptWrappableBase(TestArrayBuffer* im pl)
37 { 32 {
38 return impl->toScriptWrappableBase(); 33 return impl->toScriptWrappableBase();
39 } 34 }
40 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8 ::Isolate*) { } 35 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8 ::Isolate*) { }
41 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::I solate*) { } 36 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::I solate*) { }
42 }; 37 };
43 38
44 inline v8::Handle<v8::Object> wrap(TestException* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 39 inline v8::Handle<v8::Object> wrap(TestArrayBuffer* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
45 { 40 {
46 return impl->wrap(creationContext, isolate); 41 return impl->wrap(creationContext, isolate);
47 } 42 }
48 43
49 inline v8::Handle<v8::Value> toV8(TestException* impl, v8::Handle<v8::Object> cr eationContext, v8::Isolate* isolate) 44 inline v8::Handle<v8::Value> toV8(TestArrayBuffer* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
50 { 45 {
51 if (UNLIKELY(!impl)) 46 if (UNLIKELY(!impl))
52 return v8::Null(isolate); 47 return v8::Null(isolate);
53 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestException>(im pl, isolate); 48 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8ArrayBuffer>(impl , isolate);
54 if (!wrapper.IsEmpty()) 49 if (!wrapper.IsEmpty())
55 return wrapper; 50 return wrapper;
56 51
57 return impl->wrap(creationContext, isolate); 52 return impl->wrap(creationContext, isolate);
58 } 53 }
59 54
60 template<typename CallbackInfo> 55 template<typename CallbackInfo>
61 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestException* im pl) 56 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestArrayBuffer* impl)
62 { 57 {
63 if (UNLIKELY(!impl)) { 58 if (UNLIKELY(!impl)) {
64 v8SetReturnValueNull(callbackInfo); 59 v8SetReturnValueNull(callbackInfo);
65 return; 60 return;
66 } 61 }
67 if (DOMDataStore::setReturnValueFromWrapper<V8TestException>(callbackInfo.Ge tReturnValue(), impl)) 62 if (DOMDataStore::setReturnValueFromWrapper<V8ArrayBuffer>(callbackInfo.GetR eturnValue(), impl))
68 return; 63 return;
69 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate()); 64 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
70 v8SetReturnValue(callbackInfo, wrapper); 65 v8SetReturnValue(callbackInfo, wrapper);
71 } 66 }
72 67
73 template<typename CallbackInfo> 68 template<typename CallbackInfo>
74 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestE xception* impl) 69 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestA rrayBuffer* impl)
75 { 70 {
76 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); 71 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld());
77 if (UNLIKELY(!impl)) { 72 if (UNLIKELY(!impl)) {
78 v8SetReturnValueNull(callbackInfo); 73 v8SetReturnValueNull(callbackInfo);
79 return; 74 return;
80 } 75 }
81 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestException>(cal lbackInfo.GetReturnValue(), impl)) 76 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8ArrayBuffer>(callb ackInfo.GetReturnValue(), impl))
82 return; 77 return;
83 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate()); 78 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn fo.GetIsolate());
84 v8SetReturnValue(callbackInfo, wrapper); 79 v8SetReturnValue(callbackInfo, wrapper);
85 } 80 }
86 81
87 template<class CallbackInfo, class Wrappable> 82 template<class CallbackInfo, class Wrappable>
88 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestException * impl, Wrappable* wrappable) 83 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestArrayBuff er* impl, Wrappable* wrappable)
89 { 84 {
90 if (UNLIKELY(!impl)) { 85 if (UNLIKELY(!impl)) {
91 v8SetReturnValueNull(callbackInfo); 86 v8SetReturnValueNull(callbackInfo);
92 return; 87 return;
93 } 88 }
94 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestException>(callbackInf o.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) 89 if (DOMDataStore::setReturnValueFromWrapperFast<V8ArrayBuffer>(callbackInfo. GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
95 return; 90 return;
96 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate()); 91 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI nfo.GetIsolate());
97 v8SetReturnValue(callbackInfo, wrapper); 92 v8SetReturnValue(callbackInfo, wrapper);
98 } 93 }
99 94
100 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestException> impl, v8::Handle<v8: :Object> creationContext, v8::Isolate* isolate) 95 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestArrayBuffer> impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
101 { 96 {
102 return toV8(impl.get(), creationContext, isolate); 97 return toV8(impl.get(), creationContext, isolate);
103 } 98 }
104 99
105 template<class CallbackInfo> 100 template<class CallbackInfo>
106 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestEx ception> impl) 101 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestAr rayBuffer> impl)
107 { 102 {
108 v8SetReturnValue(callbackInfo, impl.get()); 103 v8SetReturnValue(callbackInfo, impl.get());
109 } 104 }
110 105
111 template<class CallbackInfo> 106 template<class CallbackInfo>
112 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtr<TestException> impl) 107 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR efPtr<TestArrayBuffer> impl)
113 { 108 {
114 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); 109 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
115 } 110 }
116 111
117 template<class CallbackInfo, class Wrappable> 112 template<class CallbackInfo, class Wrappable>
118 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te stException> impl, Wrappable* wrappable) 113 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te stArrayBuffer> impl, Wrappable* wrappable)
119 { 114 {
120 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); 115 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
121 } 116 }
122 117
123 } // namespace blink 118 } // namespace blink
124 119
125 #endif // V8TestException_h 120 #endif // V8ArrayBuffer_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/core/Uint8ClampedArray.idl ('k') | Source/bindings/tests/results/core/V8ArrayBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698