summaryrefslogtreecommitdiffstats
path: root/mojo/bindings
diff options
context:
space:
mode:
authorqsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-06 13:22:40 +0000
committerqsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-06 13:22:40 +0000
commit9c0eee3e8c21ba36b7ce842a776eae7a359fcf58 (patch)
tree2f91e765e191c79f1b4effa0f574936302e01806 /mojo/bindings
parent76f4b039d2dc13e2db8f047aa3a439fbcf940f8c (diff)
downloadchromium_src-9c0eee3e8c21ba36b7ce842a776eae7a359fcf58.zip
chromium_src-9c0eee3e8c21ba36b7ce842a776eae7a359fcf58.tar.gz
chromium_src-9c0eee3e8c21ba36b7ce842a776eae7a359fcf58.tar.bz2
Adding generic callback interfaces.
Mojo interfaces are asynchronous. This CL adds generic callback functions that will be used to define vase interface for return parameters to method calls. R=viettrungluu@chromium.org,rmcilroy@chromium.org Review URL: https://codereview.chromium.org/310783004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/bindings')
-rw-r--r--mojo/bindings/java/src/org/chromium/mojo/bindings/Callbacks.java121
1 files changed, 121 insertions, 0 deletions
diff --git a/mojo/bindings/java/src/org/chromium/mojo/bindings/Callbacks.java b/mojo/bindings/java/src/org/chromium/mojo/bindings/Callbacks.java
new file mode 100644
index 0000000..7b35cc0
--- /dev/null
+++ b/mojo/bindings/java/src/org/chromium/mojo/bindings/Callbacks.java
@@ -0,0 +1,121 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file was generated using
+// mojo/tools/generate_java_callback_interfaces.py
+
+package org.chromium.mojo.bindings;
+
+/**
+ * Contains a generic interface for callbacks.
+ */
+public interface Callbacks {
+
+ /**
+ * A generic 1-argument callback.
+ *
+ * @param <T1> the type of argument 1.
+ */
+ interface Callback1<T1> {
+ /**
+ * Call the callback.
+ */
+ public void call(T1 arg1);
+ }
+
+ /**
+ * A generic 2-argument callback.
+ *
+ * @param <T1> the type of argument 1.
+ * @param <T2> the type of argument 2.
+ */
+ interface Callback2<T1, T2> {
+ /**
+ * Call the callback.
+ */
+ public void call(T1 arg1, T2 arg2);
+ }
+
+ /**
+ * A generic 3-argument callback.
+ *
+ * @param <T1> the type of argument 1.
+ * @param <T2> the type of argument 2.
+ * @param <T3> the type of argument 3.
+ */
+ interface Callback3<T1, T2, T3> {
+ /**
+ * Call the callback.
+ */
+ public void call(T1 arg1, T2 arg2, T3 arg3);
+ }
+
+ /**
+ * A generic 4-argument callback.
+ *
+ * @param <T1> the type of argument 1.
+ * @param <T2> the type of argument 2.
+ * @param <T3> the type of argument 3.
+ * @param <T4> the type of argument 4.
+ */
+ interface Callback4<T1, T2, T3, T4> {
+ /**
+ * Call the callback.
+ */
+ public void call(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
+ }
+
+ /**
+ * A generic 5-argument callback.
+ *
+ * @param <T1> the type of argument 1.
+ * @param <T2> the type of argument 2.
+ * @param <T3> the type of argument 3.
+ * @param <T4> the type of argument 4.
+ * @param <T5> the type of argument 5.
+ */
+ interface Callback5<T1, T2, T3, T4, T5> {
+ /**
+ * Call the callback.
+ */
+ public void call(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
+ }
+
+ /**
+ * A generic 6-argument callback.
+ *
+ * @param <T1> the type of argument 1.
+ * @param <T2> the type of argument 2.
+ * @param <T3> the type of argument 3.
+ * @param <T4> the type of argument 4.
+ * @param <T5> the type of argument 5.
+ * @param <T6> the type of argument 6.
+ */
+ interface Callback6<T1, T2, T3, T4, T5, T6> {
+ /**
+ * Call the callback.
+ */
+ public void call(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
+ }
+
+ /**
+ * A generic 7-argument callback.
+ *
+ * @param <T1> the type of argument 1.
+ * @param <T2> the type of argument 2.
+ * @param <T3> the type of argument 3.
+ * @param <T4> the type of argument 4.
+ * @param <T5> the type of argument 5.
+ * @param <T6> the type of argument 6.
+ * @param <T7> the type of argument 7.
+ */
+ interface Callback7<T1, T2, T3, T4, T5, T6, T7> {
+ /**
+ * Call the callback.
+ */
+ public void call(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
+ }
+
+}
+