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

Unified Diff: mojo/bindings/java/src/org/chromium/mojo/bindings/MessageReceiverWithResponder.java

Issue 371603003: Adding a router class to handle messages that expect responses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rebasing Created 6 years, 5 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: mojo/bindings/java/src/org/chromium/mojo/bindings/MessageReceiverWithResponder.java
diff --git a/mojo/bindings/java/src/org/chromium/mojo/bindings/MessageReceiverWithResponder.java b/mojo/bindings/java/src/org/chromium/mojo/bindings/MessageReceiverWithResponder.java
new file mode 100644
index 0000000000000000000000000000000000000000..7e80cb1fa09a70e895bbea076a677d7273fc5f1e
--- /dev/null
+++ b/mojo/bindings/java/src/org/chromium/mojo/bindings/MessageReceiverWithResponder.java
@@ -0,0 +1,19 @@
+// 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.
+
+package org.chromium.mojo.bindings;
+
+/**
+ * A {@link MessageReceiver} that can also handle the handle the response message generated from the
+ * given message.
+ */
+public interface MessageReceiverWithResponder extends MessageReceiver {
+
+ /**
+ * A variant on Accept that registers a MessageReceiver (known as the responder) to handle the
rmcilroy 2014/07/10 19:03:58 A variant on {@link MessageReceiver#accept()} that
qsr 2014/07/11 11:42:08 The issue with this is that it will force implemen
rmcilroy 2014/07/14 14:44:56 Hmm, I really think this is generally a bad idea,
+ * response message generated from the given message. The responder's Accept method may be
+ * called during AcceptWithResponder or some time after its return.
+ */
+ boolean acceptWithResponder(Message message, MessageReceiver receiver);
rmcilroy 2014/07/10 19:03:58 /s/receiver/responder
qsr 2014/07/11 11:42:08 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698