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 #include "V8TestInterface3.h" | 7 #include "V8TestInterface3.h" |
8 | 8 |
9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
10 #include "bindings/core/v8/GeneratedCodeHelper.h" | 10 #include "bindings/core/v8/GeneratedCodeHelper.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 v8SetReturnValueString(info, impl->readonlyStringifierAttribute(), info.GetI
solate()); | 60 v8SetReturnValueString(info, impl->readonlyStringifierAttribute(), info.GetI
solate()); |
61 } | 61 } |
62 | 62 |
63 void readonlyStringifierAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 63 void readonlyStringifierAttributeAttributeGetterCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
64 { | 64 { |
65 TestInterface3V8Internal::readonlyStringifierAttributeAttributeGetter(info); | 65 TestInterface3V8Internal::readonlyStringifierAttributeAttributeGetter(info); |
66 } | 66 } |
67 | 67 |
68 static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 68 static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
69 { | 69 { |
| 70 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
| 71 |
70 if (UNLIKELY(info.Length() < 1)) { | 72 if (UNLIKELY(info.Length() < 1)) { |
71 V8ThrowException::throwException(info.GetIsolate(), V8ThrowException::cr
eateTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodD
ocument", "TestInterface3", ExceptionMessages::notEnoughArguments(1, info.Length
())))); | 73 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodDocument", "TestInterface3", ExceptionMessages::notEno
ughArguments(1, info.Length()))); |
72 return; | 74 return; |
73 } | 75 } |
74 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 76 |
75 Document* document; | 77 Document* document; |
76 { | 78 document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]); |
77 document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]); | 79 if (!document) { |
78 if (!document) { | 80 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::f
ailedToExecute("voidMethodDocument", "TestInterface3", "parameter 1 is not of ty
pe 'Document'.")); |
79 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessage
s::failedToExecute("voidMethodDocument", "TestInterface3", "parameter 1 is not o
f type 'Document'.")); | 81 |
80 return; | 82 return; |
81 } | |
82 } | 83 } |
| 84 |
83 impl->voidMethodDocument(document); | 85 impl->voidMethodDocument(document); |
84 } | 86 } |
85 | 87 |
86 static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 88 static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
87 { | 89 { |
88 TestInterface3V8Internal::voidMethodDocumentMethod(info); | 90 TestInterface3V8Internal::voidMethodDocumentMethod(info); |
89 } | 91 } |
90 | 92 |
91 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 93 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
92 { | 94 { |
93 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes
tInterface3", info.Holder(), info.GetIsolate()); | 95 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface3", "keys"); |
| 96 |
94 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 97 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
| 98 |
95 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 99 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 100 |
96 Iterator* result = impl->iterableKeys(scriptState, exceptionState); | 101 Iterator* result = impl->iterableKeys(scriptState, exceptionState); |
97 if (exceptionState.hadException()) { | 102 if (exceptionState.hadException()) { |
98 return; | 103 return; |
99 } | 104 } |
100 v8SetReturnValue(info, result); | 105 v8SetReturnValue(info, result); |
101 } | 106 } |
102 | 107 |
103 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) | 108 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
104 { | 109 { |
105 TestInterface3V8Internal::keysMethod(info); | 110 TestInterface3V8Internal::keysMethod(info); |
106 } | 111 } |
107 | 112 |
108 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 113 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
109 { | 114 { |
110 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T
estInterface3", info.Holder(), info.GetIsolate()); | 115 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface3", "values"); |
| 116 |
111 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 117 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
| 118 |
112 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 119 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 120 |
113 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); | 121 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); |
114 if (exceptionState.hadException()) { | 122 if (exceptionState.hadException()) { |
115 return; | 123 return; |
116 } | 124 } |
117 v8SetReturnValue(info, result); | 125 v8SetReturnValue(info, result); |
118 } | 126 } |
119 | 127 |
120 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 128 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
121 { | 129 { |
122 TestInterface3V8Internal::valuesMethod(info); | 130 TestInterface3V8Internal::valuesMethod(info); |
123 } | 131 } |
124 | 132 |
125 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 133 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
126 { | 134 { |
127 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", "
TestInterface3", info.Holder(), info.GetIsolate()); | 135 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface3", "entries"); |
| 136 |
128 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 137 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
| 138 |
129 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 139 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 140 |
130 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); | 141 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); |
131 if (exceptionState.hadException()) { | 142 if (exceptionState.hadException()) { |
132 return; | 143 return; |
133 } | 144 } |
134 v8SetReturnValue(info, result); | 145 v8SetReturnValue(info, result); |
135 } | 146 } |
136 | 147 |
137 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 148 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
138 { | 149 { |
139 TestInterface3V8Internal::entriesMethod(info); | 150 TestInterface3V8Internal::entriesMethod(info); |
140 } | 151 } |
141 | 152 |
142 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 153 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
143 { | 154 { |
144 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "
TestInterface3", info.Holder(), info.GetIsolate()); | 155 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface3", "forEach"); |
| 156 |
| 157 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
| 158 |
| 159 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 160 |
145 if (UNLIKELY(info.Length() < 1)) { | 161 if (UNLIKELY(info.Length() < 1)) { |
146 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 162 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
147 return; | 163 return; |
148 } | 164 } |
149 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 165 |
150 ScriptValue callback; | 166 ScriptValue callback; |
151 ScriptValue thisArg; | 167 ScriptValue thisArg; |
152 { | 168 if (!info[0]->IsFunction()) { |
153 if (!info[0]->IsFunction()) { | 169 exceptionState.throwTypeError("The callback provided as parameter 1 is n
ot a function."); |
154 exceptionState.throwTypeError("The callback provided as parameter 1
is not a function."); | 170 |
155 return; | 171 return; |
156 } | |
157 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0])
; | |
158 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); | |
159 } | 172 } |
160 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 173 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); |
| 174 |
| 175 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); |
| 176 |
161 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); | 177 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder())
, callback, thisArg, exceptionState); |
162 if (exceptionState.hadException()) { | 178 if (exceptionState.hadException()) { |
163 return; | 179 return; |
164 } | 180 } |
165 } | 181 } |
166 | 182 |
167 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 183 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
168 { | 184 { |
169 TestInterface3V8Internal::forEachMethod(info); | 185 TestInterface3V8Internal::forEachMethod(info); |
170 } | 186 } |
171 | 187 |
172 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 188 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
173 { | 189 { |
174 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 190 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
| 191 |
175 v8SetReturnValueString(info, impl->readonlyStringifierAttribute(), info.GetI
solate()); | 192 v8SetReturnValueString(info, impl->readonlyStringifierAttribute(), info.GetI
solate()); |
176 } | 193 } |
177 | 194 |
178 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 195 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
179 { | 196 { |
180 TestInterface3V8Internal::toStringMethod(info); | 197 TestInterface3V8Internal::toStringMethod(info); |
181 } | 198 } |
182 | 199 |
183 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 200 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
184 { | 201 { |
185 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator",
"TestInterface3", info.Holder(), info.GetIsolate()); | 202 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCo
ntext, "TestInterface3", "iterator"); |
| 203 |
186 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); | 204 TestInterface3* impl = V8TestInterface3::toImpl(info.Holder()); |
| 205 |
187 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 206 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 207 |
188 Iterator* result = impl->iterator(scriptState, exceptionState); | 208 Iterator* result = impl->iterator(scriptState, exceptionState); |
189 if (exceptionState.hadException()) { | 209 if (exceptionState.hadException()) { |
190 return; | 210 return; |
191 } | 211 } |
192 v8SetReturnValue(info, result); | 212 v8SetReturnValue(info, result); |
193 } | 213 } |
194 | 214 |
195 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 215 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
196 { | 216 { |
197 TestInterface3V8Internal::iteratorMethod(info); | 217 TestInterface3V8Internal::iteratorMethod(info); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 { | 348 { |
329 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 349 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
330 } | 350 } |
331 | 351 |
332 TestInterface3* V8TestInterface3::toImplWithTypeCheck(v8::Isolate* isolate, v8::
Local<v8::Value> value) | 352 TestInterface3* V8TestInterface3::toImplWithTypeCheck(v8::Isolate* isolate, v8::
Local<v8::Value> value) |
333 { | 353 { |
334 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 354 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
335 } | 355 } |
336 | 356 |
337 } // namespace blink | 357 } // namespace blink |
OLD | NEW |