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

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

Issue 144033007: IDL compiler: ForMainWorld for method arguments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 v8SetReturnValueForMainWorld(info, imp->perWorldBindingsTestInterfaceEmptyMe thod()); 257 v8SetReturnValueForMainWorld(info, imp->perWorldBindingsTestInterfaceEmptyMe thod());
258 } 258 }
259 259
260 static void perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld(c onst v8::FunctionCallbackInfo<v8::Value>& info) 260 static void perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld(c onst v8::FunctionCallbackInfo<v8::Value>& info)
261 { 261 {
262 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 262 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
263 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethodF orMainWorld(info); 263 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodMethodF orMainWorld(info);
264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 264 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
265 } 265 }
266 266
267 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod(con st v8::FunctionCallbackInfo<v8::Value>& info)
268 {
269 TestInterfaceNode* imp = V8TestInterfaceNode::toNative(info.Holder());
270 if (UNLIKELY(info.Length() <= 0)) {
271 v8SetReturnValueFast(info, imp->perWorldBindingsTestInterfaceEmptyMethod OptionalBooleanArg(), imp);
272 return;
273 }
274 V8TRYCATCH_VOID(bool, optionalBooleanArgument, info[0]->BooleanValue());
275 v8SetReturnValueFast(info, imp->perWorldBindingsTestInterfaceEmptyMethodOpti onalBooleanArg(optionalBooleanArgument), imp);
276 }
277
278 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall back(const v8::FunctionCallbackInfo<v8::Value>& info)
279 {
280 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
281 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona lBooleanArgMethod(info);
282 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
283 }
284
285 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodForM ainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
286 {
287 TestInterfaceNode* imp = V8TestInterfaceNode::toNative(info.Holder());
288 if (UNLIKELY(info.Length() <= 0)) {
289 v8SetReturnValueForMainWorld(info, imp->perWorldBindingsTestInterfaceEmp tyMethodOptionalBooleanArg());
290 return;
291 }
292 V8TRYCATCH_VOID(bool, optionalBooleanArgument, info[0]->BooleanValue());
293 v8SetReturnValueForMainWorld(info, imp->perWorldBindingsTestInterfaceEmptyMe thodOptionalBooleanArg(optionalBooleanArgument));
294 }
295
296 static void perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethodCall backForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
297 {
298 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
299 TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptiona lBooleanArgMethodForMainWorld(info);
300 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
301 }
302
267 } // namespace TestInterfaceNodeV8Internal 303 } // namespace TestInterfaceNodeV8Internal
268 304
269 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNodeAttri butes[] = { 305 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNodeAttri butes[] = {
270 {"stringAttribute", TestInterfaceNodeV8Internal::stringAttributeAttributeGet terCallback, TestInterfaceNodeV8Internal::stringAttributeAttributeSetterCallback , 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property Attribute>(v8::None), 0 /* on instance */}, 306 {"stringAttribute", TestInterfaceNodeV8Internal::stringAttributeAttributeGet terCallback, TestInterfaceNodeV8Internal::stringAttributeAttributeSetterCallback , 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::Property Attribute>(v8::None), 0 /* on instance */},
271 {"readonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8Internal::readonl yTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8: :AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 307 {"readonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8Internal::readonl yTestInterfaceEmptyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8: :AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
272 {"eventHandlerAttribute", TestInterfaceNodeV8Internal::eventHandlerAttribute AttributeGetterCallback, TestInterfaceNodeV8Internal::eventHandlerAttributeAttri buteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static _cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 308 {"eventHandlerAttribute", TestInterfaceNodeV8Internal::eventHandlerAttribute AttributeGetterCallback, TestInterfaceNodeV8Internal::eventHandlerAttributeAttri buteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static _cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
273 {"perWorldBindingsReadonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8I nternal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallb ack, 0, TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyA ttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl >(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance * /}, 309 {"perWorldBindingsReadonlyTestInterfaceEmptyAttribute", TestInterfaceNodeV8I nternal::perWorldBindingsReadonlyTestInterfaceEmptyAttributeAttributeGetterCallb ack, 0, TestInterfaceNodeV8Internal::perWorldBindingsReadonlyTestInterfaceEmptyA ttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl >(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance * /},
274 {"reflectStringAttribute", TestInterfaceNodeV8Internal::reflectStringAttribu teAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectStringAttributeAt tributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 310 {"reflectStringAttribute", TestInterfaceNodeV8Internal::reflectStringAttribu teAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectStringAttributeAt tributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
275 {"reflectUrlStringAttribute", TestInterfaceNodeV8Internal::reflectUrlStringA ttributeAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectUrlStringAt tributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFA ULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, 311 {"reflectUrlStringAttribute", TestInterfaceNodeV8Internal::reflectUrlStringA ttributeAttributeGetterCallback, TestInterfaceNodeV8Internal::reflectUrlStringAt tributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFA ULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
276 }; 312 };
277 313
278 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceNodeMethods[ ] = { 314 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceNodeMethods[ ] = {
279 {"testInterfaceEmptyMethod", TestInterfaceNodeV8Internal::testInterfaceEmpty MethodMethodCallback, 0, 0}, 315 {"testInterfaceEmptyMethod", TestInterfaceNodeV8Internal::testInterfaceEmpty MethodMethodCallback, 0, 0},
280 {"perWorldBindingsTestInterfaceEmptyMethod", TestInterfaceNodeV8Internal::pe rWorldBindingsTestInterfaceEmptyMethodMethodCallback, TestInterfaceNodeV8Interna l::perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld, 0}, 316 {"perWorldBindingsTestInterfaceEmptyMethod", TestInterfaceNodeV8Internal::pe rWorldBindingsTestInterfaceEmptyMethodMethodCallback, TestInterfaceNodeV8Interna l::perWorldBindingsTestInterfaceEmptyMethodMethodCallbackForMainWorld, 0},
317 {"perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArg", TestInterface NodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodOptionalBooleanArgMethod Callback, TestInterfaceNodeV8Internal::perWorldBindingsTestInterfaceEmptyMethodO ptionalBooleanArgMethodCallbackForMainWorld, 0},
281 }; 318 };
282 319
283 static void configureV8TestInterfaceNodeTemplate(v8::Handle<v8::FunctionTemplate > functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) 320 static void configureV8TestInterfaceNodeTemplate(v8::Handle<v8::FunctionTemplate > functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
284 { 321 {
285 functionTemplate->ReadOnlyPrototype(); 322 functionTemplate->ReadOnlyPrototype();
286 323
287 v8::Local<v8::Signature> defaultSignature; 324 v8::Local<v8::Signature> defaultSignature;
288 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceNode", V8Node::domTemplate(isolate, currentWorldType), V8Test InterfaceNode::internalFieldCount, 325 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceNode", V8Node::domTemplate(isolate, currentWorldType), V8Test InterfaceNode::internalFieldCount,
289 V8TestInterfaceNodeAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceNodeAttri butes), 326 V8TestInterfaceNodeAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceNodeAttri butes),
290 0, 0, 327 0, 0,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 fromInternalPointer(object)->deref(); 385 fromInternalPointer(object)->deref();
349 } 386 }
350 387
351 template<> 388 template<>
352 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec t> creationContext, v8::Isolate* isolate) 389 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec t> creationContext, v8::Isolate* isolate)
353 { 390 {
354 return toV8(impl, creationContext, isolate); 391 return toV8(impl, creationContext, isolate);
355 } 392 }
356 393
357 } // namespace WebCore 394 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/idls/TestObjectPython.idl ('k') | Source/bindings/tests/results/V8TestObjectPython.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698