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

Unified Diff: Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp

Issue 831483004: IDL: Make enums have global visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
diff --git a/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp b/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
index 3f646aabed350b12de5816f593daeae7ee3607a2..41123e6f3f565ee0b3b555a1c2a531087da21067 100644
--- a/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
+++ b/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp
@@ -200,6 +200,32 @@ static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
exceptionState.throwIfNeeded();
}
+static void partialVoidTestEnumModulesArgMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ if (UNLIKELY(info.Length() < 1)) {
+ V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "partialVoidTestEnumModulesArgMethod", "TestInterface", 1, info.Length()), info.GetIsolate());
+ return;
+ }
+ TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
+ V8StringResource<> arg;
+ {
+ TOSTRING_VOID_INTERNAL(arg, info[0]);
+ String string = arg;
+ if (!(string == "EnumModulesValue1" || string == "EnumModulesValue2")) {
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("partialVoidTestEnumModulesArgMethod", "TestInterface", "parameter 1 ('" + string + "') is not a valid enum value."));
+ return;
+ }
+ }
+ TestPartialInterfaceImplementation3::partialVoidTestEnumModulesArgMethod(*impl, arg);
+}
+
+static void partialVoidTestEnumModulesArgMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgMethodMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
+}
+
static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
{
V8StringResource<> value;
@@ -256,6 +282,13 @@ void V8TestInterfacePartial::installV8TestInterfaceTemplate(v8::Local<v8::Functi
void V8TestInterfacePartial::installConditionallyEnabledMethods(v8::Local<v8::Object> prototypeObject, v8::Isolate* isolate)
{
V8TestInterface::installConditionallyEnabledMethods(prototypeObject, isolate);
+ v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate));
+ ExecutionContext* context = toExecutionContext(prototypeObject->CreationContext());
+ ASSERT(context);
+
+ if (context && context->isDocument() && ContextFeatures::partialContextName3Enabled(toDocument(context))) {
+ prototypeObject->Set(v8AtomicString(isolate, "partialVoidTestEnumModulesArgMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationPartialV8Internal::partialVoidTestEnumModulesArgMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction());
+ }
}
bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPrivateScriptMethod(LocalFrame* frame, TestInterface* holderImpl, int value, int* result)
« no previous file with comments | « Source/bindings/tests/results/core/V8TestInterface.cpp ('k') | Source/core/html/canvas/HitRegionOptions.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698