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

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: Addressing comments. 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
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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* executionContext = currentExecutionContext(info.GetIsolate ());
251 String errorMessage;
252 if (!ExperimentalFeatures::featureNameEnabled(executionContext, errorMessage )) {
253 v8SetReturnValue(info, v8::Undefined(info.GetIsolate()));
254 toDocument(executionContext)->addConsoleMessage(ConsoleMessage::create( JSMessageSource, ErrorMessageLevel, errorMessage));
255 return;
256 }
248 TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgM ethodMethod(info); 257 TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgM ethodMethod(info);
249 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 258 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
250 } 259 }
251 260
252 static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::V alue>& info) 261 static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::V alue>& info)
253 { 262 {
254 V8StringResource<> value; 263 V8StringResource<> value;
255 { 264 {
256 value = info[0]; 265 value = info[0];
257 if (!value.prepare()) 266 if (!value.prepare())
(...skipping 24 matching lines...) Expand all
282 291
283 static void unscopeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value >& info) 292 static void unscopeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value >& info)
284 { 293 {
285 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 294 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
286 TestPartialInterfaceImplementation3::unscopeableVoidMethod(*impl); 295 TestPartialInterfaceImplementation3::unscopeableVoidMethod(*impl);
287 } 296 }
288 297
289 static void unscopeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info) 298 static void unscopeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info)
290 { 299 {
291 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 300 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
301 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
302 String errorMessage;
303 if (!ExperimentalFeatures::featureNameEnabled(executionContext, errorMessage )) {
304 v8SetReturnValue(info, v8::Undefined(info.GetIsolate()));
305 toDocument(executionContext)->addConsoleMessage(ConsoleMessage::create( JSMessageSource, ErrorMessageLevel, errorMessage));
306 return;
307 }
292 TestInterfaceImplementationPartialV8Internal::unscopeableVoidMethodMethod(in fo); 308 TestInterfaceImplementationPartialV8Internal::unscopeableVoidMethodMethod(in fo);
293 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 309 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
294 } 310 }
295 311
296 } // namespace TestInterfaceImplementationPartialV8Internal 312 } // namespace TestInterfaceImplementationPartialV8Internal
297 313
298 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] = { 314 const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] = {
299 {"partialVoidTestEnumModulesArgMethod", TestInterfaceImplementationPartialV8 Internal::partialVoidTestEnumModulesArgMethodMethodCallback, 0, 1, v8::None, V8D OMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, 315 {"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}, 316 {"unscopeableVoidMethod", TestInterfaceImplementationPartialV8Internal::unsc opeableVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAl lScripts, V8DOMConfiguration::OnPrototype},
301 }; 317 };
302 318
303 void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi onTemplate> functionTemplate, v8::Isolate* isolate) 319 void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi onTemplate> functionTemplate, v8::Isolate* isolate)
304 { 320 {
305 V8TestInterface::installV8TestInterfaceTemplate(functionTemplate, isolate); 321 V8TestInterface::installV8TestInterfaceTemplate(functionTemplate, isolate);
306 322
307 v8::Local<v8::Signature> defaultSignature; 323 v8::Local<v8::Signature> defaultSignature;
308 if (!RuntimeEnabledFeatures::featureNameEnabled()) 324 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); 325 0, 0,
310 else 326 0, 0,
311 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInte rface::internalFieldCount, 327 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(); 328 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT emplate();
316 ALLOW_UNUSED_LOCAL(instanceTemplate); 329 ALLOW_UNUSED_LOCAL(instanceTemplate);
317 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate(); 330 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp eTemplate();
318 ALLOW_UNUSED_LOCAL(prototypeTemplate); 331 ALLOW_UNUSED_LOCAL(prototypeTemplate);
319 const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConstants[] = { 332 const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConstants[] = {
320 {"PARTIAL3_UNSIGNED_SHORT", 0, 0, V8DOMConfiguration::ConstantTypeUnsign edShort}, 333 {"PARTIAL3_UNSIGNED_SHORT", 0, 0, V8DOMConfiguration::ConstantTypeUnsign edShort},
321 }; 334 };
322 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem plate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants)); 335 V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTem plate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants));
323 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce::legacyCallCustom); 336 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce::legacyCallCustom);
324 } 337 }
(...skipping 21 matching lines...) Expand all
346 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface( &TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod); 359 V8TestInterface::registerVoidMethodPartialOverloadMethodForPartialInterface( &TestInterfaceImplementationPartialV8Internal::voidMethodPartialOverloadMethod);
347 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver loadMethod); 360 V8TestInterface::registerStaticVoidMethodPartialOverloadMethodForPartialInte rface(&TestInterfaceImplementationPartialV8Internal::staticVoidMethodPartialOver loadMethod);
348 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe thod); 361 V8TestInterface::registerPromiseMethodPartialOverloadMethodForPartialInterfa ce(&TestInterfaceImplementationPartialV8Internal::promiseMethodPartialOverloadMe thod);
349 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti alOverloadMethod); 362 V8TestInterface::registerStaticPromiseMethodPartialOverloadMethodForPartialI nterface(&TestInterfaceImplementationPartialV8Internal::staticPromiseMethodParti alOverloadMethod);
350 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn terfaceImplementationPartialV8Internal::partial2VoidMethodMethod); 363 V8TestInterface::registerPartial2VoidMethodMethodForPartialInterface(&TestIn terfaceImplementationPartialV8Internal::partial2VoidMethodMethod);
351 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(& TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod); 364 V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface(& TestInterfaceImplementationPartialV8Internal::partial2StaticVoidMethodMethod);
352 } 365 }
353 366
354 } // namespace blink 367 } // namespace blink
355 #endif // ENABLE(CONDITION) 368 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698