Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
index cb237ecf18b6a75cd368d00f8af3f8496a81c6ff..93eecd851fd96f02664a7e33bd00b1fe75cd8aee 100644 |
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
@@ -61,6 +61,7 @@ |
#include "core/dom/MessagePort.h" |
#include "core/dom/TagCollection.h" |
#include "core/dom/custom/CustomElementProcessingStack.h" |
+#include "core/experiments/Experiments.h" |
#include "core/frame/ImageBitmap.h" |
#include "core/frame/LocalFrame.h" |
#include "core/frame/UseCounter.h" |
@@ -2854,6 +2855,90 @@ static void enforceRangeLongAttributeAttributeSetterCallback(const v8::FunctionC |
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
} |
+static void experimentRuntimeEnabledLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ String errorMessage; |
+ if (!Experiments::isApiEnabled(currentExecutionContext(info.GetIsolate()), "FeatureName", errorMessage)) { |
+ v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); |
+ return; |
+ } |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ TestObject* impl = V8TestObject::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->experimentRuntimeEnabledLongAttribute()); |
+} |
+ |
+static void experimentRuntimeEnabledLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestObjectV8Internal::experimentRuntimeEnabledLongAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void experimentRuntimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "experimentRuntimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); |
+ TestObject* impl = V8TestObject::toImpl(holder); |
+ int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ impl->setExperimentRuntimeEnabledLongAttribute(cppValue); |
+} |
+ |
+static void experimentRuntimeEnabledLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Value> v8Value = info[0]; |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestObjectV8Internal::experimentRuntimeEnabledLongAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+#if ENABLE(CONDITION) |
+static void experimentConditionalRuntimeEnabledLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ String errorMessage; |
+ if (!Experiments::isApiEnabled(currentExecutionContext(info.GetIsolate()), "FeatureName", errorMessage)) { |
+ v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); |
+ return; |
+ } |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ TestObject* impl = V8TestObject::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->experimentConditionalRuntimeEnabledLongAttribute()); |
+} |
+#endif // ENABLE(CONDITION) |
+ |
+#if ENABLE(CONDITION) |
+static void experimentConditionalRuntimeEnabledLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestObjectV8Internal::experimentConditionalRuntimeEnabledLongAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+#endif // ENABLE(CONDITION) |
+ |
+#if ENABLE(CONDITION) |
+static void experimentConditionalRuntimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "experimentConditionalRuntimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); |
+ TestObject* impl = V8TestObject::toImpl(holder); |
+ int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ impl->setExperimentConditionalRuntimeEnabledLongAttribute(cppValue); |
+} |
+#endif // ENABLE(CONDITION) |
+ |
+#if ENABLE(CONDITION) |
+static void experimentConditionalRuntimeEnabledLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Value> v8Value = info[0]; |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestObjectV8Internal::experimentConditionalRuntimeEnabledLongAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+#endif // ENABLE(CONDITION) |
+ |
static void implementedAsLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
v8::Local<v8::Object> holder = info.Holder(); |
@@ -5403,6 +5488,44 @@ static void unscopeableLongAttributeAttributeSetterCallback(const v8::FunctionCa |
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
} |
+static void unscopeableExperimentEnabledLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ String errorMessage; |
+ if (!Experiments::isApiEnabled(currentExecutionContext(info.GetIsolate()), "FeatureName", errorMessage)) { |
+ v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); |
+ return; |
+ } |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ TestObject* impl = V8TestObject::toImpl(holder); |
+ v8SetReturnValueInt(info, impl->unscopeableExperimentEnabledLongAttribute()); |
+} |
+ |
+static void unscopeableExperimentEnabledLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
+ TestObjectV8Internal::unscopeableExperimentEnabledLongAttributeAttributeGetter(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void unscopeableExperimentEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Object> holder = info.Holder(); |
+ ExceptionState exceptionState(ExceptionState::SetterContext, "unscopeableExperimentEnabledLongAttribute", "TestObject", holder, info.GetIsolate()); |
+ TestObject* impl = V8TestObject::toImpl(holder); |
+ int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ impl->setUnscopeableExperimentEnabledLongAttribute(cppValue); |
+} |
+ |
+static void unscopeableExperimentEnabledLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ v8::Local<v8::Value> v8Value = info[0]; |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
+ TestObjectV8Internal::unscopeableExperimentEnabledLongAttributeAttributeSetter(v8Value, info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
static void unscopeableRuntimeEnabledLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
v8::Local<v8::Object> holder = info.Holder(); |
@@ -9091,6 +9214,8 @@ static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(2, info.Length())) { |
case 1: |
@@ -9167,6 +9292,8 @@ static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(2, info.Length())) { |
case 1: |
@@ -9238,6 +9365,8 @@ static void overloadedMethodC2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 1: |
@@ -9298,6 +9427,8 @@ static void overloadedMethodD2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodD", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 1: |
@@ -9359,6 +9490,8 @@ static void overloadedMethodE2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodE", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 1: |
@@ -9432,6 +9565,8 @@ static void overloadedMethodF2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodF", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -9506,6 +9641,8 @@ static void overloadedMethodG2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodGMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodG", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -9577,6 +9714,8 @@ static void overloadedMethodH2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodHMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodH", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 1: |
@@ -9636,6 +9775,8 @@ static void overloadedMethodI2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodIMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodI", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 1: |
@@ -9704,6 +9845,8 @@ static void overloadedMethodJ2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodJMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodJ", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 1: |
@@ -9764,6 +9907,8 @@ static void overloadedMethodK2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodKMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodK", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 1: |
@@ -9832,6 +9977,8 @@ static void overloadedMethodL2Method(const v8::FunctionCallbackInfo<v8::Value>& |
static void overloadedMethodLMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodL", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(2, info.Length())) { |
case 1: |
@@ -9942,6 +10089,8 @@ static void promiseOverloadMethod3Method(const v8::FunctionCallbackInfo<v8::Valu |
static void promiseOverloadMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "promiseOverloadMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(2, info.Length())) { |
case 0: |
@@ -10007,6 +10156,8 @@ static void overloadedPerWorldBindingsMethod2Method(const v8::FunctionCallbackIn |
static void overloadedPerWorldBindingsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -10051,6 +10202,8 @@ static void overloadedPerWorldBindingsMethod2MethodForMainWorld(const v8::Functi |
static void overloadedPerWorldBindingsMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldBindingsMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -10110,6 +10263,8 @@ static void overloadedStaticMethod2Method(const v8::FunctionCallbackInfo<v8::Val |
static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(2, info.Length())) { |
case 1: |
@@ -10709,6 +10864,231 @@ static void doNotCheckSignatureVoidMethodMethodCallback(const v8::FunctionCallba |
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
} |
+static void experimentEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ impl->experimentEnabledVoidMethod(); |
+} |
+ |
+static void experimentEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestObjectV8Internal::experimentEnabledVoidMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void perWorldBindingsExperimentEnabledVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ impl->perWorldBindingsExperimentEnabledVoidMethod(); |
+} |
+ |
+static void perWorldBindingsExperimentEnabledVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestObjectV8Internal::perWorldBindingsExperimentEnabledVoidMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void perWorldBindingsExperimentEnabledVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ impl->perWorldBindingsExperimentEnabledVoidMethod(); |
+} |
+ |
+static void perWorldBindingsExperimentEnabledVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestObjectV8Internal::perWorldBindingsExperimentEnabledVoidMethodMethodForMainWorld(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void experimentEnabledOverloadedVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ V8StringResource<> stringArg; |
+ { |
+ stringArg = info[0]; |
+ if (!stringArg.prepare()) |
+ return; |
+ } |
+ impl->experimentEnabledOverloadedVoidMethod(stringArg); |
+} |
+ |
+static void experimentEnabledOverloadedVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "experimentEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ int longArg; |
+ { |
+ longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ } |
+ impl->experimentEnabledOverloadedVoidMethod(longArg); |
+} |
+ |
+static void experimentEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "experimentEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); |
+ switch (std::min(1, info.Length())) { |
+ case 1: |
+ if (info[0]->IsNumber()) { |
+ experimentEnabledOverloadedVoidMethod2Method(info); |
+ return; |
+ } |
+ if (true) { |
+ experimentEnabledOverloadedVoidMethod1Method(info); |
+ return; |
+ } |
+ if (true) { |
+ experimentEnabledOverloadedVoidMethod2Method(info); |
+ return; |
+ } |
+ break; |
+ default: |
+ break; |
+ } |
+ if (info.Length() < 1) { |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ exceptionState.throwTypeError("No function was found that matched the signature provided."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+} |
+ |
+static void experimentEnabledOverloadedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestObjectV8Internal::experimentEnabledOverloadedVoidMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
+static void partiallyExperimentEnabledOverloadedVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ V8StringResource<> stringArg; |
+ { |
+ stringArg = info[0]; |
+ if (!stringArg.prepare()) |
+ return; |
+ } |
+ impl->partiallyExperimentEnabledOverloadedVoidMethod(stringArg); |
+} |
+ |
+static void partiallyExperimentEnabledOverloadedVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ TestInterfaceImplementation* testInterfaceArg; |
+ { |
+ testInterfaceArg = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), info[0]); |
+ if (!testInterfaceArg) { |
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("partiallyExperimentEnabledOverloadedVoidMethod", "TestObject", "parameter 1 is not of type 'TestInterface'.")); |
+ return; |
+ } |
+ } |
+ impl->partiallyExperimentEnabledOverloadedVoidMethod(testInterfaceArg); |
+} |
+ |
+static void partiallyExperimentEnabledOverloadedVoidMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "partiallyExperimentEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ int longArg; |
+ V8StringResource<> stringArg; |
+ { |
+ longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ stringArg = info[1]; |
+ if (!stringArg.prepare()) |
+ return; |
+ } |
+ impl->partiallyExperimentEnabledOverloadedVoidMethod(longArg, stringArg); |
+} |
+ |
+static void partiallyExperimentEnabledOverloadedVoidMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "partiallyExperimentEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ int longArg; |
+ V8StringResource<> stringArg; |
+ TestInterfaceImplementation* testInterfaceArg; |
+ { |
+ longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState); |
+ if (exceptionState.throwIfNeeded()) |
+ return; |
+ stringArg = info[1]; |
+ if (!stringArg.prepare()) |
+ return; |
+ testInterfaceArg = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), info[2]); |
+ if (!testInterfaceArg) { |
+ exceptionState.throwTypeError("parameter 3 is not of type 'TestInterface'."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ } |
+ impl->partiallyExperimentEnabledOverloadedVoidMethod(longArg, stringArg, testInterfaceArg); |
+} |
+ |
+static void partiallyExperimentEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "partiallyExperimentEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); |
+ switch (std::min(3, info.Length())) { |
+ case 1: |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName2", errorMessage)) { |
+ if (V8TestInterface::hasInstance(info[0], info.GetIsolate())) { |
+ partiallyExperimentEnabledOverloadedVoidMethod2Method(info); |
+ return; |
+ } |
+ } |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName1", errorMessage)) { |
+ if (true) { |
+ partiallyExperimentEnabledOverloadedVoidMethod1Method(info); |
+ return; |
+ } |
+ } |
+ break; |
+ case 2: |
+ if (true) { |
+ partiallyExperimentEnabledOverloadedVoidMethod3Method(info); |
+ return; |
+ } |
+ break; |
+ case 3: |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName3", errorMessage)) { |
+ if (true) { |
+ partiallyExperimentEnabledOverloadedVoidMethod4Method(info); |
+ return; |
+ } |
+ } |
+ break; |
+ default: |
+ break; |
+ } |
+ if (info.Length() < 1) { |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ exceptionState.throwTypeError("No function was found that matched the signature provided."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+} |
+ |
+static void partiallyExperimentEnabledOverloadedVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
+ TestObjectV8Internal::partiallyExperimentEnabledOverloadedVoidMethodMethod(info); |
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
+} |
+ |
static void implementedAsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
TestObject* impl = V8TestObject::toImpl(info.Holder()); |
@@ -10771,6 +11151,8 @@ static void measureOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Va |
static void measureOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -10823,6 +11205,8 @@ static void DeprecateAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8 |
static void DeprecateAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -10875,6 +11259,8 @@ static void DeprecateAsSameValueOverloadedMethod2Method(const v8::FunctionCallba |
static void DeprecateAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "DeprecateAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); |
switch (std::min(1, info.Length())) { |
@@ -10926,6 +11312,8 @@ static void measureAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8:: |
static void measureAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -10978,6 +11366,8 @@ static void measureAsSameValueOverloadedMethod2Method(const v8::FunctionCallback |
static void measureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "measureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -11030,6 +11420,8 @@ static void deprecateAsMeasureAsSameValueOverloadedMethod2Method(const v8::Funct |
static void deprecateAsMeasureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 0: |
@@ -11084,6 +11476,8 @@ static void deprecateAsSameValueMeasureAsOverloadedMethod2Method(const v8::Funct |
static void deprecateAsSameValueMeasureAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::TestFeature); |
switch (std::min(1, info.Length())) { |
@@ -11137,6 +11531,8 @@ static void deprecateAsSameValueMeasureAsSameValueOverloadedMethod2Method(const |
static void deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecateAsSameValueMeasureAsSameValueOverloadedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExecutionContext(info.GetIsolate()), UseCounter::TestFeatureA); |
switch (std::min(1, info.Length())) { |
@@ -11637,6 +12033,8 @@ static void runtimeEnabledOverloadedVoidMethod2Method(const v8::FunctionCallback |
static void runtimeEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "runtimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(1, info.Length())) { |
case 1: |
@@ -11761,6 +12159,8 @@ static int partiallyRuntimeEnabledOverloadedVoidMethodMethodMaxArg() |
static void partiallyRuntimeEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "partiallyRuntimeEnabledOverloadedVoidMethod", "TestObject", info.Holder(), info.GetIsolate()); |
switch (std::min(TestObjectV8Internal::partiallyRuntimeEnabledOverloadedVoidMethodMethodMaxArg(), info.Length())) { |
case 1: |
@@ -13198,6 +13598,7 @@ const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { |
#endif // ENABLE(CONDITION) |
{"customElementCallbacksVoidMethod", TestObjectV8Internal::customElementCallbacksVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
{"deprecatedVoidMethod", TestObjectV8Internal::deprecatedVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
+ {"partiallyExperimentEnabledOverloadedVoidMethod", TestObjectV8Internal::partiallyExperimentEnabledOverloadedVoidMethodMethodCallback, 0, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
{"implementedAsVoidMethod", TestObjectV8Internal::implementedAsVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
{"measureAsVoidMethod", TestObjectV8Internal::measureAsVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
{"measureMethod", TestObjectV8Internal::measureMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
@@ -13261,6 +13662,42 @@ const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { |
{"toString", TestObjectV8Internal::toStringMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}, |
}; |
+void isexperimentRuntimeEnabledLongAttributeExperimentallyEnabled(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info) { |
+ V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); |
+ if (!perContextData) { |
+ v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); |
+ return; |
+ } |
+ v8::Isolate* isolate = perContextData->context()->GetIsolate(); |
+ String errorMessage; |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName", errorMessage)) { |
+ return v8ConstructorAttributeGetter(propertyName, info); |
+ } |
+} |
+void isexperimentConditionalRuntimeEnabledLongAttributeExperimentallyEnabled(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info) { |
+ V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); |
+ if (!perContextData) { |
+ v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); |
+ return; |
+ } |
+ v8::Isolate* isolate = perContextData->context()->GetIsolate(); |
+ String errorMessage; |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName", errorMessage)) { |
+ return v8ConstructorAttributeGetter(propertyName, info); |
+ } |
+} |
+void isunscopeableExperimentEnabledLongAttributeExperimentallyEnabled(v8::Local<v8::Name> propertyName, const v8::PropertyCallbackInfo<v8::Value>& info) { |
+ V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext()); |
+ if (!perContextData) { |
+ v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); |
+ return; |
+ } |
+ v8::Isolate* isolate = perContextData->context()->GetIsolate(); |
+ String errorMessage; |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName", errorMessage)) { |
+ return v8ConstructorAttributeGetter(propertyName, info); |
+ } |
+} |
static void installV8TestObjectTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) |
{ |
functionTemplate->ReadOnlyPrototype(); |
@@ -13277,6 +13714,9 @@ static void installV8TestObjectTemplate(v8::Local<v8::FunctionTemplate> function |
ExecutionContext* context = currentExecutionContext(isolate); |
ALLOW_UNUSED_LOCAL(context); |
if (RuntimeEnabledFeatures::featureNameEnabled()) { |
+ const V8DOMConfiguration::AccessorConfiguration accessorexperimentRuntimeEnabledLongAttributeConfiguration = \ |
+ {"experimentRuntimeEnabledLongAttribute", TestObjectV8Internal::experimentRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::experimentRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
+ V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorexperimentRuntimeEnabledLongAttributeConfiguration); |
const V8DOMConfiguration::AccessorConfiguration accessorruntimeEnabledLongAttributeConfiguration = \ |
{"runtimeEnabledLongAttribute", TestObjectV8Internal::runtimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::runtimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorruntimeEnabledLongAttributeConfiguration); |
@@ -13288,6 +13728,11 @@ static void installV8TestObjectTemplate(v8::Local<v8::FunctionTemplate> function |
{"conditionalRuntimeEnabledLongAttribute", TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::conditionalRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorconditionalRuntimeEnabledLongAttributeConfiguration); |
#endif // ENABLE(CONDITION) |
+#if ENABLE(CONDITION) |
+ const V8DOMConfiguration::AccessorConfiguration accessorexperimentConditionalRuntimeEnabledLongAttributeConfiguration = \ |
+ {"experimentConditionalRuntimeEnabledLongAttribute", TestObjectV8Internal::experimentConditionalRuntimeEnabledLongAttributeAttributeGetterCallback, TestObjectV8Internal::experimentConditionalRuntimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; |
+ V8DOMConfiguration::installAccessor(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, accessorexperimentConditionalRuntimeEnabledLongAttributeConfiguration); |
+#endif // ENABLE(CONDITION) |
} |
const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = { |
{"CONST_VALUE_0", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedShort}, |
@@ -13315,24 +13760,68 @@ static void installV8TestObjectTemplate(v8::Local<v8::FunctionTemplate> function |
{"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort}, |
}; |
V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTemplate, V8TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants)); |
+ ExecutionContext* ec = currentExecutionContext(isolate); |
+ ALLOW_UNUSED_LOCAL(ec); |
+ String constantsErrorMessage; |
+ ALLOW_UNUSED_LOCAL(constantsErrorMessage); |
if (RuntimeEnabledFeatures::featureName1Enabled()) { |
const V8DOMConfiguration::ConstantConfiguration constantFeature1EnabledConst1Configuration = {"FEATURE1_ENABLED_CONST1", 1, 0, V8DOMConfiguration::ConstantTypeShort}; |
V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature1EnabledConst1Configuration); |
const V8DOMConfiguration::ConstantConfiguration constantFeature1EnabledConst2Configuration = {"FEATURE1_ENABLED_CONST2", 2, 0, V8DOMConfiguration::ConstantTypeShort}; |
V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature1EnabledConst2Configuration); |
+ if (Experiments::isApiEnabled(ec, "FeatureName1", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFeature1RuntimeAndExperimentEnabledConst1Configuration = {"FEATURE1_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1", 1, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature1RuntimeAndExperimentEnabledConst1Configuration); |
+ } |
+ if (Experiments::isApiEnabled(ec, "FeatureName1", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFeature1RuntimeAndExperimentEnabledConst2Configuration = {"FEATURE1_RUNTIME_AND_EXPERIMENT_ENABLED_CONST2", 2, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature1RuntimeAndExperimentEnabledConst2Configuration); |
+ } |
} |
if (RuntimeEnabledFeatures::featureName2Enabled()) { |
const V8DOMConfiguration::ConstantConfiguration constantFeature2EnabledConst1Configuration = {"FEATURE2_ENABLED_CONST1", 3, 0, V8DOMConfiguration::ConstantTypeShort}; |
V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature2EnabledConst1Configuration); |
const V8DOMConfiguration::ConstantConfiguration constantFeature2EnabledConst2Configuration = {"FEATURE2_ENABLED_CONST2", 4, 0, V8DOMConfiguration::ConstantTypeShort}; |
V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature2EnabledConst2Configuration); |
+ if (Experiments::isApiEnabled(ec, "FeatureName2", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFeature2RuntimeAndExperimentEnabledConst1Configuration = {"FEATURE2_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1", 3, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature2RuntimeAndExperimentEnabledConst1Configuration); |
+ } |
+ if (Experiments::isApiEnabled(ec, "FeatureName2", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFeature2RuntimeAndExperimentEnabledConst2Configuration = {"FEATURE2_RUNTIME_AND_EXPERIMENT_ENABLED_CONST2", 4, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature2RuntimeAndExperimentEnabledConst2Configuration); |
+ } |
} |
if (RuntimeEnabledFeatures::featureName3Enabled()) { |
const V8DOMConfiguration::ConstantConfiguration constantFeature3EnabledConst1Configuration = {"FEATURE3_ENABLED_CONST1", 5, 0, V8DOMConfiguration::ConstantTypeShort}; |
V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature3EnabledConst1Configuration); |
+ if (Experiments::isApiEnabled(ec, "FeatureName3", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFeature3RuntimeAndExperimentEnabledConst1Configuration = {"FEATURE3_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1", 5, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFeature3RuntimeAndExperimentEnabledConst1Configuration); |
+ } |
} |
V8DOMConfiguration::installConstantWithGetter(isolate, functionTemplate, prototypeTemplate, "DEPRECATED_CONSTANT", TestObjectV8Internal::DEPRECATED_CONSTANTConstantGetterCallback); |
V8DOMConfiguration::installConstantWithGetter(isolate, functionTemplate, prototypeTemplate, "MEASURED_CONSTANT", TestObjectV8Internal::MEASURED_CONSTANTConstantGetterCallback); |
+ if (Experiments::isApiEnabled(ec, "FeatureName1", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFEATURE1_EXPERIMENT_ENABLED_CONST1Configuration = {"FEATURE1_EXPERIMENT_ENABLED_CONST1", 1, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFEATURE1_EXPERIMENT_ENABLED_CONST1Configuration); |
+ } |
+ if (Experiments::isApiEnabled(ec, "FeatureName1", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFEATURE1_EXPERIMENT_ENABLED_CONST2Configuration = {"FEATURE1_EXPERIMENT_ENABLED_CONST2", 2, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFEATURE1_EXPERIMENT_ENABLED_CONST2Configuration); |
+ } |
+ if (Experiments::isApiEnabled(ec, "FeatureName2", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFEATURE2_EXPERIMENT_ENABLED_CONST1Configuration = {"FEATURE2_EXPERIMENT_ENABLED_CONST1", 3, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFEATURE2_EXPERIMENT_ENABLED_CONST1Configuration); |
+ } |
+ if (Experiments::isApiEnabled(ec, "FeatureName2", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFEATURE2_EXPERIMENT_ENABLED_CONST2Configuration = {"FEATURE2_EXPERIMENT_ENABLED_CONST2", 4, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFEATURE2_EXPERIMENT_ENABLED_CONST2Configuration); |
+ } |
+ if (Experiments::isApiEnabled(ec, "FeatureName3", constantsErrorMessage)) { |
+ const V8DOMConfiguration::ConstantConfiguration constantFEATURE3_EXPERIMENT_ENABLED_CONST1Configuration = {"FEATURE3_EXPERIMENT_ENABLED_CONST1", 5, 0, V8DOMConfiguration::ConstantTypeShort}; |
+ V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantFEATURE3_EXPERIMENT_ENABLED_CONST1Configuration); |
+ } |
static_assert(0 == TestObject::CONST_VALUE_0, "the value of TestObject_CONST_VALUE_0 does not match with implementation"); |
static_assert(1 == TestObject::CONST_VALUE_1, "the value of TestObject_CONST_VALUE_1 does not match with implementation"); |
static_assert(2 == TestObject::CONST_VALUE_2, "the value of TestObject_CONST_VALUE_2 does not match with implementation"); |
@@ -13348,17 +13837,29 @@ static void installV8TestObjectTemplate(v8::Local<v8::FunctionTemplate> function |
static_assert(-0x1A == TestObject::CONST_VALUE_16, "the value of TestObject_CONST_VALUE_16 does not match with implementation"); |
static_assert(-0X1a == TestObject::CONST_VALUE_17, "the value of TestObject_CONST_VALUE_17 does not match with implementation"); |
static_assert(1 == TestObject::DEPRECATED_CONSTANT, "the value of TestObject_DEPRECATED_CONSTANT does not match with implementation"); |
+ static_assert(1 == TestObject::FEATURE1_EXPERIMENT_ENABLED_CONST1, "the value of TestObject_FEATURE1_EXPERIMENT_ENABLED_CONST1 does not match with implementation"); |
+ static_assert(2 == TestObject::FEATURE1_EXPERIMENT_ENABLED_CONST2, "the value of TestObject_FEATURE1_EXPERIMENT_ENABLED_CONST2 does not match with implementation"); |
+ static_assert(3 == TestObject::FEATURE2_EXPERIMENT_ENABLED_CONST1, "the value of TestObject_FEATURE2_EXPERIMENT_ENABLED_CONST1 does not match with implementation"); |
+ static_assert(4 == TestObject::FEATURE2_EXPERIMENT_ENABLED_CONST2, "the value of TestObject_FEATURE2_EXPERIMENT_ENABLED_CONST2 does not match with implementation"); |
+ static_assert(5 == TestObject::FEATURE3_EXPERIMENT_ENABLED_CONST1, "the value of TestObject_FEATURE3_EXPERIMENT_ENABLED_CONST1 does not match with implementation"); |
static_assert(1 == TestObject::MEASURED_CONSTANT, "the value of TestObject_MEASURED_CONSTANT does not match with implementation"); |
static_assert(1 == TestObject::FEATURE1_ENABLED_CONST1, "the value of TestObject_FEATURE1_ENABLED_CONST1 does not match with implementation"); |
static_assert(2 == TestObject::FEATURE1_ENABLED_CONST2, "the value of TestObject_FEATURE1_ENABLED_CONST2 does not match with implementation"); |
static_assert(3 == TestObject::FEATURE2_ENABLED_CONST1, "the value of TestObject_FEATURE2_ENABLED_CONST1 does not match with implementation"); |
static_assert(4 == TestObject::FEATURE2_ENABLED_CONST2, "the value of TestObject_FEATURE2_ENABLED_CONST2 does not match with implementation"); |
static_assert(5 == TestObject::FEATURE3_ENABLED_CONST1, "the value of TestObject_FEATURE3_ENABLED_CONST1 does not match with implementation"); |
+ static_assert(1 == TestObject::FEATURE1_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1, "the value of TestObject_FEATURE1_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1 does not match with implementation"); |
+ static_assert(2 == TestObject::FEATURE1_RUNTIME_AND_EXPERIMENT_ENABLED_CONST2, "the value of TestObject_FEATURE1_RUNTIME_AND_EXPERIMENT_ENABLED_CONST2 does not match with implementation"); |
+ static_assert(3 == TestObject::FEATURE2_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1, "the value of TestObject_FEATURE2_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1 does not match with implementation"); |
+ static_assert(4 == TestObject::FEATURE2_RUNTIME_AND_EXPERIMENT_ENABLED_CONST2, "the value of TestObject_FEATURE2_RUNTIME_AND_EXPERIMENT_ENABLED_CONST2 does not match with implementation"); |
+ static_assert(5 == TestObject::FEATURE3_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1, "the value of TestObject_FEATURE3_RUNTIME_AND_EXPERIMENT_ENABLED_CONST1 does not match with implementation"); |
static_assert(1 == TestObject::CONST_IMPL, "the value of TestObject_CONST_IMPL does not match with implementation"); |
v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestObjectV8Internal::indexedPropertyGetterCallback, TestObjectV8Internal::indexedPropertySetterCallback, 0, TestObjectV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestObject>, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNone); |
instanceTemplate->SetHandler(indexedPropertyHandlerConfig); |
v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestObjectV8Internal::namedPropertyGetterCallback, TestObjectV8Internal::namedPropertySetterCallback, TestObjectV8Internal::namedPropertyQueryCallback, TestObjectV8Internal::namedPropertyDeleterCallback, TestObjectV8Internal::namedPropertyEnumeratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(int(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::PropertyHandlerFlags::kNonMasking))); |
instanceTemplate->SetHandler(namedPropertyHandlerConfig); |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, TestObjectV8Internal::iteratorMethodCallback, 0, v8::DontDelete, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype }; |
V8DOMConfiguration::installMethod(isolate, prototypeTemplate, defaultSignature, symbolKeyedIteratorConfiguration); |
if (RuntimeEnabledFeatures::featureNameEnabled()) { |
@@ -13367,6 +13868,18 @@ static void installV8TestObjectTemplate(v8::Local<v8::FunctionTemplate> function |
} |
const V8DOMConfiguration::MethodConfiguration doNotCheckSignatureVoidMethodMethodConfiguration = {"doNotCheckSignatureVoidMethod", TestObjectV8Internal::doNotCheckSignatureVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}; |
V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTemplate, functionTemplate, v8::Local<v8::Signature>(), doNotCheckSignatureVoidMethodMethodConfiguration); |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName", errorMessage)) { |
+ const V8DOMConfiguration::MethodConfiguration experimentEnabledVoidMethodMethodConfiguration = {"experimentEnabledVoidMethod", TestObjectV8Internal::experimentEnabledVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}; |
+ V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, experimentEnabledVoidMethodMethodConfiguration); |
+ } |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName", errorMessage)) { |
+ const V8DOMConfiguration::MethodConfiguration perWorldBindingsExperimentEnabledVoidMethodMethodConfiguration = {"perWorldBindingsExperimentEnabledVoidMethod", TestObjectV8Internal::perWorldBindingsExperimentEnabledVoidMethodMethodCallback, TestObjectV8Internal::perWorldBindingsExperimentEnabledVoidMethodMethodCallbackForMainWorld, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}; |
+ V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, perWorldBindingsExperimentEnabledVoidMethodMethodConfiguration); |
+ } |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName", errorMessage)) { |
+ const V8DOMConfiguration::MethodConfiguration experimentEnabledOverloadedVoidMethodMethodConfiguration = {"experimentEnabledOverloadedVoidMethod", TestObjectV8Internal::experimentEnabledOverloadedVoidMethodMethodCallback, 0, 1, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}; |
+ V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, experimentEnabledOverloadedVoidMethodMethodConfiguration); |
+ } |
if (RuntimeEnabledFeatures::featureNameEnabled()) { |
const V8DOMConfiguration::MethodConfiguration runtimeEnabledVoidMethodMethodConfiguration = {"runtimeEnabledVoidMethod", TestObjectV8Internal::runtimeEnabledVoidMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype}; |
V8DOMConfiguration::installMethod(isolate, instanceTemplate, prototypeTemplate, functionTemplate, defaultSignature, runtimeEnabledVoidMethodMethodConfiguration); |
@@ -13412,6 +13925,11 @@ void V8TestObject::preparePrototypeAndInterfaceObject(v8::Local<v8::Context> con |
unscopeables = prototypeObject->Get(context, unscopablesSymbol).ToLocalChecked().As<v8::Object>(); |
else |
unscopeables = v8::Object::New(isolate); |
+ String errorMessage; |
+ ALLOW_UNUSED_LOCAL(errorMessage); |
+ if (Experiments::isApiEnabled(currentExecutionContext(isolate), "FeatureName", errorMessage)) { |
+ unscopeables->CreateDataProperty(context, v8AtomicString(isolate, "unscopeableExperimentEnabledLongAttribute"), v8::True(isolate)).FromJust(); |
+ } |
unscopeables->CreateDataProperty(context, v8AtomicString(isolate, "unscopeableLongAttribute"), v8::True(isolate)).FromJust(); |
if (RuntimeEnabledFeatures::featureNameEnabled()) { |
unscopeables->CreateDataProperty(context, v8AtomicString(isolate, "unscopeableRuntimeEnabledLongAttribute"), v8::True(isolate)).FromJust(); |