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

Unified Diff: third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp

Issue 2312093003: Generated bindings for IDL callback functions (Closed)
Patch Set: Addressed comments Created 4 years, 3 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: third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp
diff --git a/third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp b/third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..afce3fcc9312db0e81bb79ff2abd26d498aaef66
--- /dev/null
+++ b/third_party/WebKit/Source/core/testing/CallbackFunctionTest.cpp
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
bashi 2016/09/13 00:35:06 s/2014/2016/
lkawai 2016/09/16 05:05:51 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/testing/CallbackFunctionTest.h"
+
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/V8Binding.h"
+#include "bindings/core/v8/V8TestCallback.h"
+
+namespace blink {
+
+DEFINE_TRACE(CallbackFunctionTest)
+{
+}
+
+String CallbackFunctionTest::testDOMString(ScriptState* scriptState, V8TestCallback* callback, ExceptionState& exceptionState)
+{
+ String msg1 = "hello";
+ String msg2 = "world";
+ ScriptWrappable* scriptWrappable = nullptr;
+ String returnValue;
+
+ if (callback->call(scriptState, scriptWrappable, msg1, msg2, returnValue)) {
+ return String("SUCCESS: ") + returnValue; }
bashi 2016/09/13 00:35:07 Place '{' and '}' in a new line.
peria 2016/09/15 01:14:33 [style] Not correct. Keep '{' as-is. if (...) {
lkawai 2016/09/16 05:05:51 Done.
lkawai 2016/09/16 05:05:51 Done.
+ else { return String("Error!"); }
bashi 2016/09/13 00:35:06 Place '{' and '}' in a new line.
peria 2016/09/15 01:14:33 [style] In this case, you can remove 'else {' and
lkawai 2016/09/16 05:05:51 Done.
lkawai 2016/09/16 05:05:51 Done.
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698