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

Side by Side Diff: Source/bindings/tests/results/V8TestEventTarget.cpp

Issue 18677002: [Binding] use V8TRYCATCH_VOID and raw pointer in indexed setter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 5 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 /* 1 /*
2 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 v8SetReturnValue(info, toV8Fast(element.release(), info, collection)); 176 v8SetReturnValue(info, toV8Fast(element.release(), info, collection));
177 } 177 }
178 178
179 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) 179 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info)
180 { 180 {
181 TRACE_EVENT_SAMPLING_STATE0("Blink\0Blink-DOMIndexedProperty"); 181 TRACE_EVENT_SAMPLING_STATE0("Blink\0Blink-DOMIndexedProperty");
182 TestEventTargetV8Internal::indexedPropertyGetter(index, info); 182 TestEventTargetV8Internal::indexedPropertyGetter(index, info);
183 TRACE_EVENT_SAMPLING_STATE0("V8\0V8-Execution"); 183 TRACE_EVENT_SAMPLING_STATE0("V8\0V8-Execution");
184 } 184 }
185 185
186 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> value, co nst v8::PropertyCallbackInfo<v8::Value>& info)
187 {
188 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder());
189 V8TRYCATCH_VOID(Node*, propertyValue, V8Node::HasInstance(value, info.GetIso late(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>: :Cast(value)) : 0);
190 bool result = collection->anonymousIndexedSetter(index, propertyValue);
191 if (!result)
192 return;
193 v8SetReturnValue(info, value);
194 }
195
196 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v alue, const v8::PropertyCallbackInfo<v8::Value>& info)
197 {
198 TRACE_EVENT_SAMPLING_STATE0("Blink\0Blink-DOMIndexedProperty");
199 TestEventTargetV8Internal::indexedPropertySetter(index, value, info);
200 TRACE_EVENT_SAMPLING_STATE0("V8\0V8-Execution");
201 }
202
186 static void indexedPropertyDeleter(unsigned index, const v8::PropertyCallbackInf o<v8::Boolean>& info) 203 static void indexedPropertyDeleter(unsigned index, const v8::PropertyCallbackInf o<v8::Boolean>& info)
187 { 204 {
188 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder()); 205 TestEventTarget* collection = V8TestEventTarget::toNative(info.Holder());
189 ExceptionCode ec = 0; 206 ExceptionCode ec = 0;
190 bool result = collection->anonymousIndexedDeleter(index, ec); 207 bool result = collection->anonymousIndexedDeleter(index, ec);
191 if (ec) { 208 if (ec) {
192 setDOMException(ec, info.GetIsolate()); 209 setDOMException(ec, info.GetIsolate());
193 return; 210 return;
194 } 211 }
195 return v8SetReturnValueBool(info, result); 212 return v8SetReturnValueBool(info, result);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 347
331 v8::Local<v8::Signature> defaultSignature; 348 v8::Local<v8::Signature> defaultSignature;
332 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestEventTar get", v8::Local<v8::FunctionTemplate>(), V8TestEventTarget::internalFieldCount, 349 defaultSignature = V8DOMConfiguration::configureTemplate(desc, "TestEventTar get", v8::Local<v8::FunctionTemplate>(), V8TestEventTarget::internalFieldCount,
333 0, 0, 350 0, 0,
334 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), is olate, currentWorldType); 351 V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods), is olate, currentWorldType);
335 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used. 352 UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
336 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate(); 353 v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
337 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate(); 354 v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
338 UNUSED_PARAM(instance); // In some cases, it will not be used. 355 UNUSED_PARAM(instance); // In some cases, it will not be used.
339 UNUSED_PARAM(proto); // In some cases, it will not be used. 356 UNUSED_PARAM(proto); // In some cases, it will not be used.
340 desc->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTargetV8Interna l::indexedPropertyGetterCallback, 0, 0, TestEventTargetV8Internal::indexedProper tyDeleterCallback, indexedPropertyEnumerator<TestEventTarget>); 357 desc->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTargetV8Interna l::indexedPropertyGetterCallback, TestEventTargetV8Internal::indexedPropertySett erCallback, 0, TestEventTargetV8Internal::indexedPropertyDeleterCallback, indexe dPropertyEnumerator<TestEventTarget>);
341 desc->InstanceTemplate()->SetNamedPropertyHandler(TestEventTargetV8Internal: :namedPropertyGetterCallback, TestEventTargetV8Internal::namedPropertySetterCall back, TestEventTargetV8Internal::namedPropertyQueryCallback, TestEventTargetV8In ternal::namedPropertyDeleterCallback, TestEventTargetV8Internal::namedPropertyEn umeratorCallback); 358 desc->InstanceTemplate()->SetNamedPropertyHandler(TestEventTargetV8Internal: :namedPropertyGetterCallback, TestEventTargetV8Internal::namedPropertySetterCall back, TestEventTargetV8Internal::namedPropertyQueryCallback, TestEventTargetV8In ternal::namedPropertyDeleterCallback, TestEventTargetV8Internal::namedPropertyEn umeratorCallback);
342 desc->InstanceTemplate()->MarkAsUndetectable(); 359 desc->InstanceTemplate()->MarkAsUndetectable();
343 360
344 // Custom Signature 'dispatchEvent' 361 // Custom Signature 'dispatchEvent'
345 const int dispatchEventArgc = 1; 362 const int dispatchEventArgc = 1;
346 v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8 PerIsolateData::from(isolate)->rawTemplate(&V8Event::info, currentWorldType) }; 363 v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8 PerIsolateData::from(isolate)->rawTemplate(&V8Event::info, currentWorldType) };
347 v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv); 364 v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv);
348 proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New (TestEventTargetV8Internal::dispatchEventMethodCallback, v8Undefined(), dispatch EventSignature, 1)); 365 proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New (TestEventTargetV8Internal::dispatchEventMethodCallback, v8Undefined(), dispatch EventSignature, 1));
349 366
350 // Custom toString template 367 // Custom toString template
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 installPerContextProperties(wrapper, impl.get(), isolate); 413 installPerContextProperties(wrapper, impl.get(), isolate);
397 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, Wrap perConfiguration::Independent); 414 V8DOMWrapper::associateObjectWithWrapper(impl, &info, wrapper, isolate, Wrap perConfiguration::Independent);
398 return wrapper; 415 return wrapper;
399 } 416 }
400 void V8TestEventTarget::derefObject(void* object) 417 void V8TestEventTarget::derefObject(void* object)
401 { 418 {
402 static_cast<TestEventTarget*>(object)->deref(); 419 static_cast<TestEventTarget*>(object)->deref();
403 } 420 }
404 421
405 } // namespace WebCore 422 } // namespace WebCore
OLDNEW
« Source/bindings/scripts/CodeGeneratorV8.pm ('K') | « Source/bindings/tests/idls/TestEventTarget.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698