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 V8TestObject_h | 7 #ifndef V8TestObject_h |
8 #define V8TestObject_h | 8 #define V8TestObject_h |
9 | 9 |
| 10 #include "V8EventTarget.h" |
10 #include "bindings/tests/idls/TestObject.h" | 11 #include "bindings/tests/idls/TestObject.h" |
11 #include "bindings/v8/V8Binding.h" | 12 #include "bindings/v8/V8Binding.h" |
12 #include "bindings/v8/V8DOMWrapper.h" | 13 #include "bindings/v8/V8DOMWrapper.h" |
13 #include "bindings/v8/WrapperTypeInfo.h" | 14 #include "bindings/v8/WrapperTypeInfo.h" |
14 #include "heap/Handle.h" | 15 #include "heap/Handle.h" |
15 | 16 |
16 namespace WebCore { | 17 namespace WebCore { |
17 | 18 |
18 class V8TestObject { | 19 class V8TestObject { |
19 public: | 20 public: |
20 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); | 21 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); |
21 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); | 22 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); |
22 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); |
23 static TestObject* toNative(v8::Handle<v8::Object> object) | 24 static TestObject* toNative(v8::Handle<v8::Object> object) |
24 { | 25 { |
25 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 26 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
26 } | 27 } |
27 static TestObject* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>
); | 28 static TestObject* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>
); |
28 static const WrapperTypeInfo wrapperTypeInfo; | 29 static const WrapperTypeInfo wrapperTypeInfo; |
29 static void derefObject(void*); | 30 static void derefObject(void*); |
30 static void customVoidMethodMethodCustom(const v8::FunctionCallbackInfo<v8::
Value>&); | 31 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
31 #if ENABLE(CONDITION) | 32 static void customMethodMethodCustom(const v8::FunctionCallbackInfo<v8::Valu
e>&); |
32 static void conditionalConditionCustomVoidMethodMethodCustom(const v8::Funct
ionCallbackInfo<v8::Value>&); | 33 static void customMethodWithArgsMethodCustom(const v8::FunctionCallbackInfo<
v8::Value>&); |
33 #endif // ENABLE(CONDITION) | 34 static void classMethod2MethodCustom(const v8::FunctionCallbackInfo<v8::Valu
e>&); |
34 static void customObjectAttributeAttributeGetterCustom(const v8::PropertyCal
lbackInfo<v8::Value>&); | 35 static void customAttrAttributeGetterCustom(const v8::PropertyCallbackInfo<v
8::Value>&); |
35 static void customObjectAttributeAttributeSetterCustom(v8::Local<v8::Value>,
const v8::PropertyCallbackInfo<void>&); | 36 static void customAttrAttributeSetterCustom(v8::Local<v8::Value>, const v8::
PropertyCallbackInfo<void>&); |
36 static void customGetterLongAttributeAttributeGetterCustom(const v8::Propert
yCallbackInfo<v8::Value>&); | 37 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun
t + 0; |
37 static void customGetterReadonlyObjectAttributeAttributeGetterCustom(const v
8::PropertyCallbackInfo<v8::Value>&); | 38 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1
; |
38 static void customSetterLongAttributeAttributeSetterCustom(v8::Local<v8::Val
ue>, const v8::PropertyCallbackInfo<void>&); | |
39 #if ENABLE(CONDITION) | |
40 static void customLongAttributeAttributeGetterCustom(const v8::PropertyCallb
ackInfo<v8::Value>&); | |
41 #endif // ENABLE(CONDITION) | |
42 #if ENABLE(CONDITION) | |
43 static void customLongAttributeAttributeSetterCustom(v8::Local<v8::Value>, c
onst v8::PropertyCallbackInfo<void>&); | |
44 #endif // ENABLE(CONDITION) | |
45 static void customImplementedAsLongAttributeAttributeGetterCustom(const v8::
PropertyCallbackInfo<v8::Value>&); | |
46 static void customImplementedAsLongAttributeAttributeSetterCustom(v8::Local<
v8::Value>, const v8::PropertyCallbackInfo<void>&); | |
47 static void customGetterImplementedAsLongAttributeAttributeGetterCustom(cons
t v8::PropertyCallbackInfo<v8::Value>&); | |
48 static void customSetterImplementedAsLongAttributeAttributeSetterCustom(v8::
Local<v8::Value>, const v8::PropertyCallbackInfo<void>&); | |
49 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | |
50 static inline void* toInternalPointer(TestObject* impl) | 39 static inline void* toInternalPointer(TestObject* impl) |
51 { | 40 { |
52 return impl; | 41 return V8EventTarget::toInternalPointer(impl); |
53 } | 42 } |
54 | 43 |
55 static inline TestObject* fromInternalPointer(void* object) | 44 static inline TestObject* fromInternalPointer(void* object) |
56 { | 45 { |
57 return static_cast<TestObject*>(object); | 46 return static_cast<TestObject*>(V8EventTarget::fromInternalPointer(objec
t)); |
58 } | 47 } |
59 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestO
bject*, v8::Isolate*); | 48 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestO
bject*, v8::Isolate*); |
60 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*); | 49 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*); |
61 | 50 |
62 private: | 51 private: |
63 friend v8::Handle<v8::Object> wrap(TestObject*, v8::Handle<v8::Object> creat
ionContext, v8::Isolate*); | 52 friend v8::Handle<v8::Object> wrap(TestObject*, v8::Handle<v8::Object> creat
ionContext, v8::Isolate*); |
64 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestObject>, v8::Hand
le<v8::Object> creationContext, v8::Isolate*); | 53 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestObject>, v8::Hand
le<v8::Object> creationContext, v8::Isolate*); |
65 }; | 54 }; |
66 | 55 |
67 inline v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) | 56 inline v8::Handle<v8::Object> wrap(TestObject* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) |
(...skipping 22 matching lines...) Expand all Loading... |
90 } | 79 } |
91 if (DOMDataStore::setReturnValueFromWrapper<V8TestObject>(callbackInfo.GetRe
turnValue(), impl)) | 80 if (DOMDataStore::setReturnValueFromWrapper<V8TestObject>(callbackInfo.GetRe
turnValue(), impl)) |
92 return; | 81 return; |
93 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 82 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
94 v8SetReturnValue(callbackInfo, wrapper); | 83 v8SetReturnValue(callbackInfo, wrapper); |
95 } | 84 } |
96 | 85 |
97 template<typename CallbackInfo> | 86 template<typename CallbackInfo> |
98 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestO
bject* impl) | 87 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestO
bject* impl) |
99 { | 88 { |
100 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); | 89 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate())->isMainWorld()); |
101 if (UNLIKELY(!impl)) { | 90 if (UNLIKELY(!impl)) { |
102 v8SetReturnValueNull(callbackInfo); | 91 v8SetReturnValueNull(callbackInfo); |
103 return; | 92 return; |
104 } | 93 } |
105 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObject>(callba
ckInfo.GetReturnValue(), impl)) | 94 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObject>(callba
ckInfo.GetReturnValue(), impl)) |
106 return; | 95 return; |
107 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 96 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
108 v8SetReturnValue(callbackInfo, wrapper); | 97 v8SetReturnValue(callbackInfo, wrapper); |
109 } | 98 } |
110 | 99 |
(...skipping 28 matching lines...) Expand all Loading... |
139 } | 128 } |
140 | 129 |
141 template<class CallbackInfo, class Wrappable> | 130 template<class CallbackInfo, class Wrappable> |
142 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stObject> impl, Wrappable* wrappable) | 131 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stObject> impl, Wrappable* wrappable) |
143 { | 132 { |
144 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 133 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
145 } | 134 } |
146 | 135 |
147 } | 136 } |
148 #endif // V8TestObject_h | 137 #endif // V8TestObject_h |
OLD | NEW |