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

Side by Side Diff: Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp

Issue 1085453003: IDL: Add support for [Unscopeable] on attributes and methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixes Created 5 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 "config.h" 7 #include "config.h"
8 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterfacePartial.h" 9 #include "V8TestInterfacePartial.h"
10 10
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 break; 275 break;
276 default: 276 default:
277 break; 277 break;
278 } 278 }
279 exceptionState.throwTypeError("No function was found that matched the signat ure provided."); 279 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
280 exceptionState.throwIfNeeded(); 280 exceptionState.throwIfNeeded();
281 return; 281 return;
282 } 282 }
283 283
284 static void unscopeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value >& info)
285 {
286 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
287 TestPartialInterfaceImplementation3::unscopeableVoidMethod(*impl);
288 }
289
290 static void unscopeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info)
291 {
292 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
293 TestInterfaceImplementationPartialV8Internal::unscopeableVoidMethodMethod(in fo);
294 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
295 }
296
284 } // namespace TestInterfaceImplementationPartialV8Internal 297 } // namespace TestInterfaceImplementationPartialV8Internal
285 298
286 void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi onTemplate> functionTemplate, v8::Isolate* isolate) 299 void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi onTemplate> functionTemplate, v8::Isolate* isolate)
287 { 300 {
288 V8TestInterface::installV8TestInterfaceTemplate(functionTemplate, isolate); 301 V8TestInterface::installV8TestInterfaceTemplate(functionTemplate, isolate);
289 302
290 v8::Local<v8::Signature> defaultSignature; 303 v8::Local<v8::Signature> defaultSignature;
291 if (!RuntimeEnabledFeatures::featureNameEnabled()) 304 if (!RuntimeEnabledFeatures::featureNameEnabled())
292 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "", v8::Local<v8::FunctionTemplate>(), V8TestInterface::intern alFieldCount, 0, 0, 0, 0, 0, 0); 305 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "", v8::Local<v8::FunctionTemplate>(), V8TestInterface::intern alFieldCount, 0, 0, 0, 0, 0, 0);
293 else 306 else
294 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInte rface::internalFieldCount, 307 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInte rface::internalFieldCount,
295 0, 0, 308 0, 0,
296 0, 0, 309 0, 0,
297 0, 0); 310 0, 0);
298 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 311 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
299 ALLOW_UNUSED_LOCAL(instanceTemplate); 312 ALLOW_UNUSED_LOCAL(instanceTemplate);
300 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 313 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
301 ALLOW_UNUSED_LOCAL(prototypeTemplate); 314 ALLOW_UNUSED_LOCAL(prototypeTemplate);
302 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConsta nts[] = { 315 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConsta nts[] = {
303 {"PARTIAL3_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUns ignedShort}, 316 {"PARTIAL3_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUns ignedShort},
304 }; 317 };
305 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem plate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants)); 318 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem plate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants));
306 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce::legacyCallCustom); 319 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce::legacyCallCustom);
307 } 320 }
308 321
309 void V8TestInterfacePartial::installConditionallyEnabledMethods(v8::Local<v8::Ob ject> prototypeObject, v8::Isolate* isolate) 322 void V8TestInterfacePartial::preparePrototypeObject(v8::Isolate* isolate, v8::Lo cal<v8::Object> prototypeObject)
310 { 323 {
311 V8TestInterface::installConditionallyEnabledMethods(prototypeObject, isolate ); 324 V8TestInterface::preparePrototypeObject(isolate, prototypeObject);
325 v8::Local<v8::Context> v8Context(prototypeObject->CreationContext());
326 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate));
327 v8::Local<v8::Object> unscopeables;
328 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymb ol)))
329 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLoca lChecked().As<v8::Object>();
330 else
331 unscopeables = v8::Object::New(isolate);
332 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "unscopeableVoidMe thod"), v8::True(isolate)).FromJust();
333 prototypeObject->ForceSet(v8Context, unscopablesSymbol, unscopeables).FromJu st();
312 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT emplate(isolate)); 334 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT emplate(isolate));
313 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext()); 335 ExecutionContext* context = toExecutionContext(prototypeObject->CreationCont ext());
314 ASSERT(context); 336 ASSERT(context);
315
316 if (context && context->isDocument() && ContextFeatures::partialContextName3 Enabled(toDocument(context))) { 337 if (context && context->isDocument() && ContextFeatures::partialContextName3 Enabled(toDocument(context))) {
317 prototypeObject->Set(v8AtomicString(isolate, "partialVoidTestEnumModules ArgMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationParti alV8Internal::partialVoidTestEnumModulesArgMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction(isolate->GetCurrentContext()).ToLocalChecked() ); 338 prototypeObject->Set(v8AtomicString(isolate, "partialVoidTestEnumModules ArgMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationParti alV8Internal::partialVoidTestEnumModulesArgMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction(isolate->GetCurrentContext()).ToLocalChecked() );
318 } 339 }
340 if (context && context->isDocument() && ContextFeatures::partialContextName3 Enabled(toDocument(context))) {
341 prototypeObject->Set(v8AtomicString(isolate, "unscopeableVoidMethod"), v 8::FunctionTemplate::New(isolate, TestInterfaceImplementationPartialV8Internal:: unscopeableVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFun ction(isolate->GetCurrentContext()).ToLocalChecked());
342 }
319 } 343 }
320 344
321 bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr ivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int* result) 345 bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr ivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int* result)
322 { 346 {
323 if (!frame) 347 if (!frame)
324 return false; 348 return false;
325 v8::HandleScope handleScope(toIsolate(frame)); 349 v8::HandleScope handleScope(toIsolate(frame));
326 ScriptForbiddenScope::AllowUserAgentScript script; 350 ScriptForbiddenScope::AllowUserAgentScript script;
327 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld()); 351 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe rWorld::privateScriptIsolatedWorld());
328 if (contextInPrivateScript.IsEmpty()) 352 if (contextInPrivateScript.IsEmpty())
(...skipping 18 matching lines...) Expand all
347 *result = cppValue; 371 *result = cppValue;
348 RELEASE_ASSERT(!exceptionState.hadException()); 372 RELEASE_ASSERT(!exceptionState.hadException());
349 return true; 373 return true;
350 } 374 }
351 375
352 void V8TestInterfacePartial::initialize() 376 void V8TestInterfacePartial::initialize()
353 { 377 {
354 // Should be invoked from initModules. 378 // Should be invoked from initModules.
355 V8TestInterface::updateWrapperTypeInfo( 379 V8TestInterface::updateWrapperTypeInfo(
356 &V8TestInterfacePartial::installV8TestInterfaceTemplate, 380 &V8TestInterfacePartial::installV8TestInterfaceTemplate,
357 &V8TestInterfacePartial::installConditionallyEnabledMethods); 381 &V8TestInterfacePartial::preparePrototypeObject);
358 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface( &TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod); 382 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface( &TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod);
359 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver loadMethod); 383 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver loadMethod);
360 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe thod); 384 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe thod);
361 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti alOverloadMethod); 385 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti alOverloadMethod);
362 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn terfaceImplementationPartialV8Internal::partial2VoidMethodMethod); 386 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn terfaceImplementationPartialV8Internal::partial2VoidMethodMethod);
363 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(& TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod); 387 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(& TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod);
364 } 388 }
365 389
366 } // namespace blink 390 } // namespace blink
367 #endif // ENABLE(CONDITION) 391 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/modules/V8TestInterfacePartial.h ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698