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

Unified Diff: Source/bindings/tests/results/core/V8TestInterface2.cpp

Issue 911433003: IDL: Auto-declare remaining methods implied by maplike<>/setlike<> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-iterable-continued
Patch Set: Created 5 years, 10 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/core/V8TestInterface2.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterface2.cpp b/Source/bindings/tests/results/core/V8TestInterface2.cpp
index 172fd3447f397ce773ac0e663be17505f6f1b46d..24cc5e94cb1c38cae4ac6257995e539f2547da14 100644
--- a/Source/bindings/tests/results/core/V8TestInterface2.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterface2.cpp
@@ -326,6 +326,35 @@ static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
+static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "TestInterface2", info.Holder(), info.GetIsolate());
+ if (UNLIKELY(info.Length() < 1)) {
+ setMinimumArityTypeError(exceptionState, 1, info.Length());
+ exceptionState.throwIfNeeded();
+ return;
+ }
+ TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
+ TestInterfaceEmpty* value;
+ {
+ value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]);
+ }
+ ScriptState* scriptState = ScriptState::current(info.GetIsolate());
+ bool result = impl->has(scriptState, value, exceptionState);
+ if (exceptionState.hadException()) {
+ exceptionState.throwIfNeeded();
+ return;
+ }
+ v8SetReturnValueBool(info, result);
+}
+
+static void hasMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ TestInterface2V8Internal::hasMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
+}
+
static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
@@ -585,6 +614,7 @@ static const V8DOMConfiguration::MethodConfiguration V8TestInterface2Methods[] =
{"values", TestInterface2V8Internal::valuesMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
{"entries", TestInterface2V8Internal::entriesMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
{"forEach", TestInterface2V8Internal::forEachMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
+ {"has", TestInterface2V8Internal::hasMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
{"toString", TestInterface2V8Internal::toStringMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
};

Powered by Google App Engine
This is Rietveld 408576698