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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp

Issue 1873323002: Have bindings layer assume and insist that all interface types are GCed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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
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 #include "V8TestInterface2.h" 7 #include "V8TestInterface2.h"
8 8
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 11 matching lines...) Expand all
22 #include "wtf/RefPtr.h" 22 #include "wtf/RefPtr.h"
23 23
24 namespace blink { 24 namespace blink {
25 25
26 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial 26 // Suppress warning: global constructors, because struct WrapperTypeInfo is triv ial
27 // and does not depend on another global objects. 27 // and does not depend on another global objects.
28 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 28 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
29 #pragma clang diagnostic push 29 #pragma clang diagnostic push
30 #pragma clang diagnostic ignored "-Wglobal-constructors" 30 #pragma clang diagnostic ignored "-Wglobal-constructors"
31 #endif 31 #endif
32 const WrapperTypeInfo V8TestInterface2::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface2::domTemplate, V8TestInterface2::refObject, V8TestInterface2::d erefObject, V8TestInterface2::trace, V8TestInterface2::toActiveScriptWrappable, V8TestInterface2::visitDOMWrapper, V8TestInterface2::preparePrototypeAndInterfac eObject, V8TestInterface2::installConditionallyEnabledProperties, "TestInterface 2", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClass Id, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Dependent, Wrap perTypeInfo::RefCountedObject }; 32 const WrapperTypeInfo V8TestInterface2::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface2::domTemplate, V8TestInterface2::trace, V8TestInterface2::toAct iveScriptWrappable, V8TestInterface2::visitDOMWrapper, V8TestInterface2::prepare PrototypeAndInterfaceObject, V8TestInterface2::installConditionallyEnabledProper ties, "TestInterface2", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperT ypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeI nfo::Dependent };
33 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 33 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
34 #pragma clang diagnostic pop 34 #pragma clang diagnostic pop
35 #endif 35 #endif
36 36
37 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac e2.h. 37 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac e2.h.
38 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 38 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
39 // bindings/core/v8/ScriptWrappable.h. 39 // bindings/core/v8/ScriptWrappable.h.
40 const WrapperTypeInfo& TestInterface2::s_wrapperTypeInfo = V8TestInterface2::wra pperTypeInfo; 40 const WrapperTypeInfo& TestInterface2::s_wrapperTypeInfo = V8TestInterface2::wra pperTypeInfo;
41 41
42 namespace TestInterface2V8Internal { 42 namespace TestInterface2V8Internal {
43 43
44 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 44 static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
45 { 45 {
46 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes tInterface2", info.Holder(), info.GetIsolate()); 46 ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "Tes tInterface2", info.Holder(), info.GetIsolate());
47 if (UNLIKELY(info.Length() < 1)) { 47 if (UNLIKELY(info.Length() < 1)) {
48 setMinimumArityTypeError(exceptionState, 1, info.Length()); 48 setMinimumArityTypeError(exceptionState, 1, info.Length());
49 exceptionState.throwIfNeeded(); 49 exceptionState.throwIfNeeded();
50 return; 50 return;
51 } 51 }
52 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 52 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
53 unsigned index; 53 unsigned index;
54 { 54 {
55 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception State); 55 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception State);
56 if (exceptionState.throwIfNeeded()) 56 if (exceptionState.throwIfNeeded())
57 return; 57 return;
58 } 58 }
59 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState); 59 TestInterfaceEmpty* result = impl->item(index, exceptionState);
60 if (exceptionState.hadException()) { 60 if (exceptionState.hadException()) {
61 exceptionState.throwIfNeeded(); 61 exceptionState.throwIfNeeded();
62 return; 62 return;
63 } 63 }
64 v8SetReturnValue(info, result.release()); 64 v8SetReturnValue(info, result);
65 } 65 }
66 66
67 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 67 static void itemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
68 { 68 {
69 TestInterface2V8Internal::itemMethod(info); 69 TestInterface2V8Internal::itemMethod(info);
70 } 70 }
71 71
72 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 72 static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
73 { 73 {
74 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate()); 74 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", " TestInterface2", info.Holder(), info.GetIsolate());
75 if (UNLIKELY(info.Length() < 2)) { 75 if (UNLIKELY(info.Length() < 2)) {
76 setMinimumArityTypeError(exceptionState, 2, info.Length()); 76 setMinimumArityTypeError(exceptionState, 2, info.Length());
77 exceptionState.throwIfNeeded(); 77 exceptionState.throwIfNeeded();
78 return; 78 return;
79 } 79 }
80 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 80 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
81 unsigned index; 81 unsigned index;
82 TestInterfaceEmpty* value; 82 TestInterfaceEmpty* value;
83 { 83 {
84 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception State); 84 index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exception State);
85 if (exceptionState.throwIfNeeded()) 85 if (exceptionState.throwIfNeeded())
86 return; 86 return;
87 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf o[1]); 87 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf o[1]);
88 if (!value) { 88 if (!value) {
89 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter faceEmpty'."); 89 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter faceEmpty'.");
90 exceptionState.throwIfNeeded(); 90 exceptionState.throwIfNeeded();
91 return; 91 return;
92 } 92 }
93 } 93 }
94 RefPtr<TestInterfaceEmpty> result = impl->setItem(index, value, exceptionSta te); 94 TestInterfaceEmpty* result = impl->setItem(index, value, exceptionState);
95 if (exceptionState.hadException()) { 95 if (exceptionState.hadException()) {
96 exceptionState.throwIfNeeded(); 96 exceptionState.throwIfNeeded();
97 return; 97 return;
98 } 98 }
99 v8SetReturnValue(info, result.release()); 99 v8SetReturnValue(info, result);
100 } 100 }
101 101
102 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 102 static void setItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
103 { 103 {
104 TestInterface2V8Internal::setItemMethod(info); 104 TestInterface2V8Internal::setItemMethod(info);
105 } 105 }
106 106
107 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 107 static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
108 { 108 {
109 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate()); 109 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem" , "TestInterface2", info.Holder(), info.GetIsolate());
(...skipping 30 matching lines...) Expand all
140 exceptionState.throwIfNeeded(); 140 exceptionState.throwIfNeeded();
141 return; 141 return;
142 } 142 }
143 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 143 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
144 V8StringResource<> name; 144 V8StringResource<> name;
145 { 145 {
146 name = info[0]; 146 name = info[0];
147 if (!name.prepare()) 147 if (!name.prepare())
148 return; 148 return;
149 } 149 }
150 RefPtr<TestInterfaceEmpty> result = impl->namedItem(name, exceptionState); 150 TestInterfaceEmpty* result = impl->namedItem(name, exceptionState);
151 if (exceptionState.hadException()) { 151 if (exceptionState.hadException()) {
152 exceptionState.throwIfNeeded(); 152 exceptionState.throwIfNeeded();
153 return; 153 return;
154 } 154 }
155 v8SetReturnValue(info, result.release()); 155 v8SetReturnValue(info, result);
156 } 156 }
157 157
158 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 158 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
159 { 159 {
160 TestInterface2V8Internal::namedItemMethod(info); 160 TestInterface2V8Internal::namedItemMethod(info);
161 } 161 }
162 162
163 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 163 static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
164 { 164 {
165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate()); 165 ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedIte m", "TestInterface2", info.Holder(), info.GetIsolate());
166 if (UNLIKELY(info.Length() < 2)) { 166 if (UNLIKELY(info.Length() < 2)) {
167 setMinimumArityTypeError(exceptionState, 2, info.Length()); 167 setMinimumArityTypeError(exceptionState, 2, info.Length());
168 exceptionState.throwIfNeeded(); 168 exceptionState.throwIfNeeded();
169 return; 169 return;
170 } 170 }
171 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 171 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
172 V8StringResource<> name; 172 V8StringResource<> name;
173 TestInterfaceEmpty* value; 173 TestInterfaceEmpty* value;
174 { 174 {
175 name = info[0]; 175 name = info[0];
176 if (!name.prepare()) 176 if (!name.prepare())
177 return; 177 return;
178 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf o[1]); 178 value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), inf o[1]);
179 if (!value && !isUndefinedOrNull(info[1])) { 179 if (!value && !isUndefinedOrNull(info[1])) {
180 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter faceEmpty'."); 180 exceptionState.throwTypeError("parameter 2 is not of type 'TestInter faceEmpty'.");
181 exceptionState.throwIfNeeded(); 181 exceptionState.throwIfNeeded();
182 return; 182 return;
183 } 183 }
184 } 184 }
185 RefPtr<TestInterfaceEmpty> result = impl->setNamedItem(name, value, exceptio nState); 185 TestInterfaceEmpty* result = impl->setNamedItem(name, value, exceptionState) ;
186 if (exceptionState.hadException()) { 186 if (exceptionState.hadException()) {
187 exceptionState.throwIfNeeded(); 187 exceptionState.throwIfNeeded();
188 return; 188 return;
189 } 189 }
190 v8SetReturnValue(info, result.release()); 190 v8SetReturnValue(info, result);
191 } 191 }
192 192
193 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info) 193 static void setNamedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)
194 { 194 {
195 TestInterface2V8Internal::setNamedItemMethod(info); 195 TestInterface2V8Internal::setNamedItemMethod(info);
196 } 196 }
197 197
198 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o) 198 static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf o)
199 { 199 {
200 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate()); 200 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamed Item", "TestInterface2", info.Holder(), info.GetIsolate());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 static void stringifierMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 232 static void stringifierMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
233 { 233 {
234 TestInterface2V8Internal::stringifierMethodMethod(info); 234 TestInterface2V8Internal::stringifierMethodMethod(info);
235 } 235 }
236 236
237 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 237 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
238 { 238 {
239 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes tInterface2", info.Holder(), info.GetIsolate()); 239 ExceptionState exceptionState(ExceptionState::ExecutionContext, "keys", "Tes tInterface2", info.Holder(), info.GetIsolate());
240 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 240 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
241 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 241 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
242 RawPtr<Iterator> result = impl->keysForBinding(scriptState, exceptionState); 242 Iterator* result = impl->keysForBinding(scriptState, exceptionState);
243 if (exceptionState.hadException()) { 243 if (exceptionState.hadException()) {
244 exceptionState.throwIfNeeded(); 244 exceptionState.throwIfNeeded();
245 return; 245 return;
246 } 246 }
247 v8SetReturnValue(info, result.release()); 247 v8SetReturnValue(info, result);
248 } 248 }
249 249
250 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 250 static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
251 { 251 {
252 TestInterface2V8Internal::keysMethod(info); 252 TestInterface2V8Internal::keysMethod(info);
253 } 253 }
254 254
255 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 255 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
256 { 256 {
257 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T estInterface2", info.Holder(), info.GetIsolate()); 257 ExceptionState exceptionState(ExceptionState::ExecutionContext, "values", "T estInterface2", info.Holder(), info.GetIsolate());
258 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 258 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
259 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 259 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
260 RawPtr<Iterator> result = impl->valuesForBinding(scriptState, exceptionState ); 260 Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
261 if (exceptionState.hadException()) { 261 if (exceptionState.hadException()) {
262 exceptionState.throwIfNeeded(); 262 exceptionState.throwIfNeeded();
263 return; 263 return;
264 } 264 }
265 v8SetReturnValue(info, result.release()); 265 v8SetReturnValue(info, result);
266 } 266 }
267 267
268 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info ) 268 static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info )
269 { 269 {
270 TestInterface2V8Internal::valuesMethod(info); 270 TestInterface2V8Internal::valuesMethod(info);
271 } 271 }
272 272
273 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 273 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
274 { 274 {
275 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", " TestInterface2", info.Holder(), info.GetIsolate()); 275 ExceptionState exceptionState(ExceptionState::ExecutionContext, "entries", " TestInterface2", info.Holder(), info.GetIsolate());
276 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 276 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
277 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 277 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
278 RawPtr<Iterator> result = impl->entriesForBinding(scriptState, exceptionStat e); 278 Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
279 if (exceptionState.hadException()) { 279 if (exceptionState.hadException()) {
280 exceptionState.throwIfNeeded(); 280 exceptionState.throwIfNeeded();
281 return; 281 return;
282 } 282 }
283 v8SetReturnValue(info, result.release()); 283 v8SetReturnValue(info, result);
284 } 284 }
285 285
286 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 286 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
287 { 287 {
288 TestInterface2V8Internal::entriesMethod(info); 288 TestInterface2V8Internal::entriesMethod(info);
289 } 289 }
290 290
291 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 291 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
292 { 292 {
293 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", " TestInterface2", info.Holder(), info.GetIsolate()); 293 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", " TestInterface2", info.Holder(), info.GetIsolate());
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo) 362 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
363 { 363 {
364 TestInterface2V8Internal::toStringMethod(info); 364 TestInterface2V8Internal::toStringMethod(info);
365 } 365 }
366 366
367 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 367 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
368 { 368 {
369 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface2", info.Holder(), info.GetIsolate()); 369 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface2", info.Holder(), info.GetIsolate());
370 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 370 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
371 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 371 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
372 RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState); 372 Iterator* result = impl->iterator(scriptState, exceptionState);
373 if (exceptionState.hadException()) { 373 if (exceptionState.hadException()) {
374 exceptionState.throwIfNeeded(); 374 exceptionState.throwIfNeeded();
375 return; 375 return;
376 } 376 }
377 v8SetReturnValue(info, result.release()); 377 v8SetReturnValue(info, result);
378 } 378 }
379 379
380 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo) 380 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
381 { 381 {
382 TestInterface2V8Internal::iteratorMethod(info); 382 TestInterface2V8Internal::iteratorMethod(info);
383 } 383 }
384 384
385 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 385 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
386 { 386 {
387 RefPtr<TestInterface2> impl = TestInterface2::create(); 387 TestInterface2* impl = TestInterface2::create();
388 v8::Local<v8::Object> wrapper = info.Holder(); 388 v8::Local<v8::Object> wrapper = info.Holder();
389 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface2::w rapperTypeInfo, wrapper); 389 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface2::w rapperTypeInfo, wrapper);
390 v8SetReturnValue(info, wrapper); 390 v8SetReturnValue(info, wrapper);
391 } 391 }
392 392
393 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 393 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
394 { 394 {
395 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 395 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
396 ExceptionState exceptionState(ExceptionState::IndexedGetterContext, "TestInt erface2", info.Holder(), info.GetIsolate()); 396 ExceptionState exceptionState(ExceptionState::IndexedGetterContext, "TestInt erface2", info.Holder(), info.GetIsolate());
397 RefPtr<TestInterfaceEmpty> result = impl->item(index, exceptionState); 397 TestInterfaceEmpty* result = impl->item(index, exceptionState);
398 if (exceptionState.throwIfNeeded()) 398 if (exceptionState.throwIfNeeded())
399 return; 399 return;
400 if (!result) 400 if (!result)
401 return; 401 return;
402 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); 402 v8SetReturnValueFast(info, result, impl);
403 } 403 }
404 404
405 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) 405 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info)
406 { 406 {
407 TestInterface2V8Internal::indexedPropertyGetter(index, info); 407 TestInterface2V8Internal::indexedPropertyGetter(index, info);
408 } 408 }
409 409
410 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 410 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
411 { 411 {
412 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 412 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 TestInterface2V8Internal::indexedPropertyDeleter(index, info); 446 TestInterface2V8Internal::indexedPropertyDeleter(index, info);
447 } 447 }
448 448
449 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info) 449 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info)
450 { 450 {
451 auto nameString = name.As<v8::String>(); 451 auto nameString = name.As<v8::String>();
452 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 452 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
453 AtomicString propertyName = toCoreAtomicString(nameString); 453 AtomicString propertyName = toCoreAtomicString(nameString);
454 v8::String::Utf8Value namedProperty(nameString); 454 v8::String::Utf8Value namedProperty(nameString);
455 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate()); 455 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate());
456 RefPtr<TestInterfaceEmpty> result = impl->namedItem(propertyName, exceptionS tate); 456 TestInterfaceEmpty* result = impl->namedItem(propertyName, exceptionState);
457 if (exceptionState.throwIfNeeded()) 457 if (exceptionState.throwIfNeeded())
458 return; 458 return;
459 if (!result) 459 if (!result)
460 return; 460 return;
461 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); 461 v8SetReturnValueFast(info, result, impl);
462 } 462 }
463 463
464 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info) 464 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info)
465 { 465 {
466 TestInterface2V8Internal::namedPropertyGetter(name, info); 466 TestInterface2V8Internal::namedPropertyGetter(name, info);
467 } 467 }
468 468
469 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 469 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
470 { 470 {
471 auto nameString = name.As<v8::String>(); 471 auto nameString = name.As<v8::String>();
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 TestInterface2* V8TestInterface2::toImplWithTypeCheck(v8::Isolate* isolate, v8:: Local<v8::Value> value) 646 TestInterface2* V8TestInterface2::toImplWithTypeCheck(v8::Isolate* isolate, v8:: Local<v8::Value> value)
647 { 647 {
648 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0; 648 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu e)) : 0;
649 } 649 }
650 650
651 ActiveScriptWrappable* V8TestInterface2::toActiveScriptWrappable(v8::Local<v8::O bject> wrapper) 651 ActiveScriptWrappable* V8TestInterface2::toActiveScriptWrappable(v8::Local<v8::O bject> wrapper)
652 { 652 {
653 return toImpl(wrapper); 653 return toImpl(wrapper);
654 } 654 }
655 655
656 void V8TestInterface2::refObject(ScriptWrappable* scriptWrappable)
657 {
658 scriptWrappable->toImpl<TestInterface2>()->ref();
659 }
660
661 void V8TestInterface2::derefObject(ScriptWrappable* scriptWrappable)
662 {
663 scriptWrappable->toImpl<TestInterface2>()->deref();
664 }
665
666 } // namespace blink 656 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698