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 V8TestInterfaceDocument_h | 7 #ifndef V8TestEventTarget_h |
8 #define V8TestInterfaceDocument_h | 8 #define V8TestEventTarget_h |
9 | 9 |
10 #include "V8Document.h" | 10 #include "V8EventTarget.h" |
11 #include "bindings/tests/idls/TestInterfaceDocument.h" | 11 #include "bindings/tests/idls/TestEventTarget.h" |
12 #include "bindings/v8/V8Binding.h" | 12 #include "bindings/v8/V8Binding.h" |
13 #include "bindings/v8/V8DOMWrapper.h" | 13 #include "bindings/v8/V8DOMWrapper.h" |
14 #include "bindings/v8/WrapperTypeInfo.h" | 14 #include "bindings/v8/WrapperTypeInfo.h" |
15 #include "heap/Handle.h" | 15 #include "heap/Handle.h" |
16 | 16 |
17 namespace WebCore { | 17 namespace WebCore { |
18 | 18 |
19 class V8TestInterfaceDocument { | 19 class V8TestEventTarget { |
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 v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); |
23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); | 23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*); |
24 static TestInterfaceDocument* toNative(v8::Handle<v8::Object> object) | 24 static TestEventTarget* toNative(v8::Handle<v8::Object> object) |
25 { | 25 { |
26 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 26 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
27 } | 27 } |
28 static TestInterfaceDocument* toNativeWithTypeCheck(v8::Isolate*, v8::Handle
<v8::Value>); | 28 static TestEventTarget* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::V
alue>); |
29 static const WrapperTypeInfo wrapperTypeInfo; | 29 static const WrapperTypeInfo wrapperTypeInfo; |
30 static void derefObject(void*); | 30 static void derefObject(void*); |
31 static EventTarget* toEventTarget(v8::Handle<v8::Object>); | 31 static EventTarget* toEventTarget(v8::Handle<v8::Object>); |
32 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 32 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun
t + 0; |
33 static inline void* toInternalPointer(TestInterfaceDocument* impl) | 33 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1
; |
| 34 static inline void* toInternalPointer(TestEventTarget* impl) |
34 { | 35 { |
35 return V8Document::toInternalPointer(impl); | 36 return V8EventTarget::toInternalPointer(impl); |
36 } | 37 } |
37 | 38 |
38 static inline TestInterfaceDocument* fromInternalPointer(void* object) | 39 static inline TestEventTarget* fromInternalPointer(void* object) |
39 { | 40 { |
40 return static_cast<TestInterfaceDocument*>(V8Document::fromInternalPoint
er(object)); | 41 return static_cast<TestEventTarget*>(V8EventTarget::fromInternalPointer(
object)); |
41 } | 42 } |
42 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfaceDocument*, v8::Isolate*) { } | 43 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestE
ventTarget*, v8::Isolate*) { } |
43 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 44 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } |
44 | 45 |
45 private: | 46 private: |
46 friend v8::Handle<v8::Object> wrap(TestInterfaceDocument*, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate*); | 47 friend v8::Handle<v8::Object> wrap(TestEventTarget*, v8::Handle<v8::Object>
creationContext, v8::Isolate*); |
47 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceDocument
>, v8::Handle<v8::Object> creationContext, v8::Isolate*); | 48 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestEventTarget>, v8:
:Handle<v8::Object> creationContext, v8::Isolate*); |
48 }; | 49 }; |
49 | 50 |
50 v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate*); | 51 inline v8::Handle<v8::Object> wrap(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
| 52 { |
| 53 ASSERT(impl); |
| 54 ASSERT(!DOMDataStore::containsWrapper<V8TestEventTarget>(impl, isolate)); |
| 55 return V8TestEventTarget::createWrapper(impl, creationContext, isolate); |
| 56 } |
51 | 57 |
52 inline v8::Handle<v8::Value> toV8(TestInterfaceDocument* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | 58 inline v8::Handle<v8::Value> toV8(TestEventTarget* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
53 { | 59 { |
54 if (UNLIKELY(!impl)) | 60 if (UNLIKELY(!impl)) |
55 return v8::Null(isolate); | 61 return v8::Null(isolate); |
56 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceDocu
ment>(impl, isolate); | 62 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestEventTarget>(
impl, isolate); |
57 if (!wrapper.IsEmpty()) | 63 if (!wrapper.IsEmpty()) |
58 return wrapper; | 64 return wrapper; |
59 return wrap(impl, creationContext, isolate); | 65 return wrap(impl, creationContext, isolate); |
60 } | 66 } |
61 | 67 |
62 template<typename CallbackInfo> | 68 template<typename CallbackInfo> |
63 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceDocu
ment* impl) | 69 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestEventTarget*
impl) |
64 { | 70 { |
65 if (UNLIKELY(!impl)) { | 71 if (UNLIKELY(!impl)) { |
66 v8SetReturnValueNull(callbackInfo); | 72 v8SetReturnValueNull(callbackInfo); |
67 return; | 73 return; |
68 } | 74 } |
69 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceDocument>(callbac
kInfo.GetReturnValue(), impl)) | 75 if (DOMDataStore::setReturnValueFromWrapper<V8TestEventTarget>(callbackInfo.
GetReturnValue(), impl)) |
70 return; | 76 return; |
71 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 77 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
72 v8SetReturnValue(callbackInfo, wrapper); | 78 v8SetReturnValue(callbackInfo, wrapper); |
73 } | 79 } |
74 | 80 |
75 template<typename CallbackInfo> | 81 template<typename CallbackInfo> |
76 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfaceDocument* impl) | 82 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestE
ventTarget* impl) |
77 { | 83 { |
78 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld()); | 84 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate())->isMainWorld()); |
79 if (UNLIKELY(!impl)) { | 85 if (UNLIKELY(!impl)) { |
80 v8SetReturnValueNull(callbackInfo); | 86 v8SetReturnValueNull(callbackInfo); |
81 return; | 87 return; |
82 } | 88 } |
83 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceDocum
ent>(callbackInfo.GetReturnValue(), impl)) | 89 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestEventTarget>(c
allbackInfo.GetReturnValue(), impl)) |
84 return; | 90 return; |
85 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 91 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
86 v8SetReturnValue(callbackInfo, wrapper); | 92 v8SetReturnValue(callbackInfo, wrapper); |
87 } | 93 } |
88 | 94 |
89 template<class CallbackInfo, class Wrappable> | 95 template<class CallbackInfo, class Wrappable> |
90 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
Document* impl, Wrappable* wrappable) | 96 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestEventTarg
et* impl, Wrappable* wrappable) |
91 { | 97 { |
92 if (UNLIKELY(!impl)) { | 98 if (UNLIKELY(!impl)) { |
93 v8SetReturnValueNull(callbackInfo); | 99 v8SetReturnValueNull(callbackInfo); |
94 return; | 100 return; |
95 } | 101 } |
96 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceDocument>(cal
lbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 102 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestEventTarget>(callbackI
nfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
97 return; | 103 return; |
98 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 104 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
99 v8SetReturnValue(callbackInfo, wrapper); | 105 v8SetReturnValue(callbackInfo, wrapper); |
100 } | 106 } |
101 | 107 |
102 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceDocument> impl, v8::Ha
ndle<v8::Object> creationContext, v8::Isolate* isolate) | 108 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestEventTarget> impl, v8::Handle<v
8::Object> creationContext, v8::Isolate* isolate) |
103 { | 109 { |
104 return toV8(impl.get(), creationContext, isolate); | 110 return toV8(impl.get(), creationContext, isolate); |
105 } | 111 } |
106 | 112 |
107 template<class CallbackInfo> | 113 template<class CallbackInfo> |
108 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfaceDocument> impl) | 114 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestEv
entTarget> impl) |
109 { | 115 { |
110 v8SetReturnValue(callbackInfo, impl.get()); | 116 v8SetReturnValue(callbackInfo, impl.get()); |
111 } | 117 } |
112 | 118 |
113 template<class CallbackInfo> | 119 template<class CallbackInfo> |
114 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfaceDocument> impl) | 120 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestEventTarget> impl) |
115 { | 121 { |
116 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 122 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
117 } | 123 } |
118 | 124 |
119 template<class CallbackInfo, class Wrappable> | 125 template<class CallbackInfo, class Wrappable> |
120 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfaceDocument> impl, Wrappable* wrappable) | 126 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stEventTarget> impl, Wrappable* wrappable) |
121 { | 127 { |
122 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 128 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
123 } | 129 } |
124 | 130 |
125 } | 131 } |
126 #endif // V8TestInterfaceDocument_h | 132 #endif // V8TestEventTarget_h |
OLD | NEW |