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/V8TestInterfaceDocument.cpp

Issue 938403007: Support [TypeChecking] on dependent/partial interfaces. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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/V8TestInterfaceDocument.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp b/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
index c45519e86c901e7c6d78b1e543c92aa33958c0ef..48629032e50ca59635d0ef4d1a2090fb47528884 100644
--- a/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp
@@ -9,8 +9,10 @@
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
+#include "bindings/core/v8/V8Document.h"
#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
+#include "bindings/tests/idls/core/TestPartialInterface4.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -29,6 +31,30 @@ const WrapperTypeInfo& TestInterfaceDocument::s_wrapperTypeInfo = V8TestInterfac
namespace TestInterfaceDocumentV8Internal {
+static void voidMethodDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ if (UNLIKELY(info.Length() < 1)) {
+ V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "voidMethodDocument", "TestInterfaceDocument", 1, info.Length()), info.GetIsolate());
+ return;
+ }
+ Document* document;
+ {
+ document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]);
+ if (!document) {
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodDocument", "TestInterfaceDocument", "parameter 1 is not of type 'Document'."));
+ return;
+ }
+ }
+ TestPartialInterface4::voidMethodDocument(document);
+}
+
+static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+ TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
+ TestInterfaceDocumentV8Internal::voidMethodDocumentMethod(info);
+ TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
+}
+
} // namespace TestInterfaceDocumentV8Internal
static void installV8TestInterfaceDocumentTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
@@ -44,6 +70,10 @@ static void installV8TestInterfaceDocumentTemplate(v8::Local<v8::FunctionTemplat
ALLOW_UNUSED_LOCAL(instanceTemplate);
v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
ALLOW_UNUSED_LOCAL(prototypeTemplate);
+ const V8DOMConfiguration::MethodConfiguration voidMethodDocumentMethodConfiguration = {
+ "voidMethodDocument", TestInterfaceDocumentV8Internal::voidMethodDocumentMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts,
+ };
+ V8DOMConfiguration::installMethod(isolate, functionTemplate, v8::Local<v8::Signature>(), v8::None, voidMethodDocumentMethodConfiguration);
// Custom toString template
functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());

Powered by Google App Engine
This is Rietveld 408576698