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

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

Issue 1531443003: [bindings] Implement an ExperimentEnabled IDL extended attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed. Much less added generations. Created 4 years, 11 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 "V8TestInterfacePartial.h" 7 #include "V8TestInterfacePartial.h"
8 8
9 #if ENABLE(CONDITION) 9 #if ENABLE(CONDITION)
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/PrivateScriptRunner.h" 11 #include "bindings/core/v8/PrivateScriptRunner.h"
12 #include "bindings/core/v8/ScriptPromise.h" 12 #include "bindings/core/v8/ScriptPromise.h"
13 #include "bindings/core/v8/V8DOMConfiguration.h" 13 #include "bindings/core/v8/V8DOMConfiguration.h"
14 #include "bindings/core/v8/V8Document.h" 14 #include "bindings/core/v8/V8Document.h"
15 #include "bindings/core/v8/V8Node.h" 15 #include "bindings/core/v8/V8Node.h"
16 #include "bindings/core/v8/V8ObjectConstructor.h" 16 #include "bindings/core/v8/V8ObjectConstructor.h"
17 #include "bindings/core/v8/V8TestInterface.h" 17 #include "bindings/core/v8/V8TestInterface.h"
18 #include "bindings/tests/idls/modules/TestPartialInterfaceImplementation3.h" 18 #include "bindings/tests/idls/modules/TestPartialInterfaceImplementation3.h"
19 #include "core/dom/ContextFeatures.h" 19 #include "core/dom/ContextFeatures.h"
20 #include "core/dom/Document.h" 20 #include "core/dom/Document.h"
21 #include "core/experiments/ExperimentalFeatures.h"
21 #include "core/frame/LocalFrame.h" 22 #include "core/frame/LocalFrame.h"
23 #include "core/inspector/ConsoleMessage.h"
22 #include "platform/RuntimeEnabledFeatures.h" 24 #include "platform/RuntimeEnabledFeatures.h"
23 #include "platform/ScriptForbiddenScope.h" 25 #include "platform/ScriptForbiddenScope.h"
24 #include "platform/TraceEvent.h" 26 #include "platform/TraceEvent.h"
25 #include "wtf/GetPtr.h" 27 #include "wtf/GetPtr.h"
26 #include "wtf/RefPtr.h" 28 #include "wtf/RefPtr.h"
27 #include "wtf/build_config.h" 29 #include "wtf/build_config.h"
28 30
29 namespace blink { 31 namespace blink {
30 32
31 namespace TestInterfaceImplementationPartialV8Internal { 33 namespace TestInterfaceImplementationPartialV8Internal {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 exceptionState.throwIfNeeded(); 240 exceptionState.throwIfNeeded();
239 return; 241 return;
240 } 242 }
241 } 243 }
242 TestPartialInterfaceImplementation3::partialVoidTestEnumModulesArgMethod(*im pl, arg); 244 TestPartialInterfaceImplementation3::partialVoidTestEnumModulesArgMethod(*im pl, arg);
243 } 245 }
244 246
245 static void partialVoidTestEnumModulesArgMethodMethodCallback(const v8::Function CallbackInfo<v8::Value>& info) 247 static void partialVoidTestEnumModulesArgMethodMethodCallback(const v8::Function CallbackInfo<v8::Value>& info)
246 { 248 {
247 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 249 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
250 ExecutionContext* executionContextFromIsolate = currentExecutionContext(info .GetIsolate());
251 String errorMessage;
252 if (!ExperimentalFeatures::featureNameEnabled(executionContextFromIsolate, e rrorMessage)) {
253 v8SetReturnValue(info, v8::Undefined(info.GetIsolate()));
254 Document& document = *toDocument(executionContextFromIsolate);
255 document.addConsoleMessage(ConsoleMessage::create(JSMessageSource, Erro rMessageLevel, errorMessage));
256 return;
257 }
248 TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgM ethodMethod(info); 258 TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgM ethodMethod(info);
249 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 259 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
250 } 260 }
251 261
252 static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::V alue>& info) 262 static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::V alue>& info)
253 { 263 {
254 V8StringResource<> value; 264 V8StringResource<> value;
255 { 265 {
256 value = info[0]; 266 value = info[0];
257 if (!value.prepare()) 267 if (!value.prepare())
(...skipping 24 matching lines...) Expand all
282 292
283 static void unscopeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value >& info) 293 static void unscopeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value >& info)
284 { 294 {
285 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 295 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
286 TestPartialInterfaceImplementation3::unscopeableVoidMethod(*impl); 296 TestPartialInterfaceImplementation3::unscopeableVoidMethod(*impl);
287 } 297 }
288 298
289 static void unscopeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info) 299 static void unscopeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info)
290 { 300 {
291 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 301 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
302 ExecutionContext* executionContextFromIsolate = currentExecutionContext(info .GetIsolate());
303 String errorMessage;
304 if (!ExperimentalFeatures::featureNameEnabled(executionContextFromIsolate, e rrorMessage)) {
305 v8SetReturnValue(info, v8::Undefined(info.GetIsolate()));
306 Document& document = *toDocument(executionContextFromIsolate);
307 document.addConsoleMessage(ConsoleMessage::create(JSMessageSource, Erro rMessageLevel, errorMessage));
308 return;
309 }
292 TestInterfaceImplementationPartialV8Internal::unscopeableVoidMethodMethod(in fo); 310 TestInterfaceImplementationPartialV8Internal::unscopeableVoidMethodMethod(in fo);
293 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 311 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
294 } 312 }
295 313
296 } // namespace TestInterfaceImplementationPartialV8Internal 314 } // namespace TestInterfaceImplementationPartialV8Internal
297 315
298 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] = { 316 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] = {
299 {"partialVoidTestEnumModulesArgMethod", TestInterfaceImplementationPartialV8 Internal::partialVoidTestEnumModulesArgMethodMethodCallback, 0, 1, v8::None, V8D OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, 317 {"partialVoidTestEnumModulesArgMethod", TestInterfaceImplementationPartialV8 Internal::partialVoidTestEnumModulesArgMethodMethodCallback, 0, 1, v8::None, V8D OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype},
300 {"unscopeableVoidMethod", TestInterfaceImplementationPartialV8Internal::unsc opeableVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAl lScripts, V8DOMConfiguration::OnPrototype}, 318 {"unscopeableVoidMethod", TestInterfaceImplementationPartialV8Internal::unsc opeableVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAl lScripts, V8DOMConfiguration::OnPrototype},
301 }; 319 };
302 320
303 void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi onTemplate> functionTemplate, v8::Isolate* isolate) 321 void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi onTemplate> functionTemplate, v8::Isolate* isolate)
304 { 322 {
305 V8TestInterface::installV8TestInterfaceTemplate(functionTemplate, isolate); 323 V8TestInterface::installV8TestInterfaceTemplate(functionTemplate, isolate);
306 324
307 v8::Local<v8::Signature> defaultSignature; 325 v8::Local<v8::Signature> defaultSignature;
308 if (!RuntimeEnabledFeatures::featureNameEnabled()) 326 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, func tionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterfac e::internalFieldCount,
309 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInte rface::internalFieldCount, 0, 0, 0, 0, 0, 0); 327 0, 0,
310 else 328 0, 0,
311 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInte rface::internalFieldCount, 329 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods));
312 0, 0,
313 0, 0,
314 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods));
315 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate(); 330 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
316 ALLOW_UNUSED_LOCAL(instanceTemplate); 331 ALLOW_UNUSED_LOCAL(instanceTemplate);
317 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 332 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
318 ALLOW_UNUSED_LOCAL(prototypeTemplate); 333 ALLOW_UNUSED_LOCAL(prototypeTemplate);
319 const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConstants[] = { 334 const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConstants[] = {
320 {"PARTIAL3_UNSIGNED_SHORT", 0, 0, V8DOMConfiguration::ConstantTypeUnsign edShort}, 335 {"PARTIAL3_UNSIGNED_SHORT", 0, 0, V8DOMConfiguration::ConstantTypeUnsign edShort},
321 }; 336 };
322 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem plate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants)); 337 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem plate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants));
323 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce::legacyCallCustom); 338 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce::legacyCallCustom);
324 } 339 }
(...skipping 21 matching lines...) Expand all
346 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface( &TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod); 361 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface( &TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod);
347 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver loadMethod); 362 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver loadMethod);
348 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe thod); 363 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe thod);
349 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti alOverloadMethod); 364 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti alOverloadMethod);
350 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn terfaceImplementationPartialV8Internal::partial2VoidMethodMethod); 365 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn terfaceImplementationPartialV8Internal::partial2VoidMethodMethod);
351 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(& TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod); 366 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(& TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod);
352 } 367 }
353 368
354 } // namespace blink 369 } // namespace blink
355 #endif // ENABLE(CONDITION) 370 #endif // ENABLE(CONDITION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698