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

Unified 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, 12 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
index 5d50486dbd5718f48e7f89529b9e353f82849f7c..c22791a6c322bee3ecf9bbba49b2c37f40355eaf 100644
--- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
@@ -18,7 +18,9 @@
#include "bindings/tests/idls/modules/TestPartialInterfaceImplementation3.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
+#include "core/experiments/ExperimentalFeatures.h"
#include "core/frame/LocalFrame.h"
+#include "core/inspector/ConsoleMessage.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/ScriptForbiddenScope.h"
#include "platform/TraceEvent.h"
@@ -245,6 +247,13 @@ static void partialVoidTestEnumModulesArgMethodMethod(const v8::FunctionCallback
static void partialVoidTestEnumModulesArgMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
+ String errorMessage;
+ if (!ExperimentalFeatures::featureNameEnabled(executionContext, errorMessage)) {
+ v8SetReturnValue(info, v8::Undefined(info.GetIsolate()));
+ toDocument(executionContext)->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage));
+ return;
+ }
TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
@@ -289,6 +298,13 @@ static void unscopeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
static void unscopeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
+ String errorMessage;
+ if (!ExperimentalFeatures::featureNameEnabled(executionContext, errorMessage)) {
+ v8SetReturnValue(info, v8::Undefined(info.GetIsolate()));
+ toDocument(executionContext)->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage));
+ return;
+ }
TestInterfaceImplementationPartialV8Internal::unscopeableVoidMethodMethod(info);
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
@@ -305,13 +321,10 @@ void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi
V8TestInterface::installV8TestInterfaceTemplate(functionTemplate, isolate);
v8::Local<v8::Signature> defaultSignature;
- if (!RuntimeEnabledFeatures::featureNameEnabled())
- defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount, 0, 0, 0, 0, 0, 0);
- else
- defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount,
- 0, 0,
- 0, 0,
- V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods));
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount,
+ 0, 0,
+ 0, 0,
+ V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods));
v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
ALLOW_UNUSED_LOCAL(instanceTemplate);
v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
« 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