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

Unified Diff: chrome/browser/extensions/api/messaging/native_messaging_channel.h

Issue 558403002: Remote Assistance on Chrome OS Part II - Native Messaging renaming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | remoting/host/DEPS » ('j') | remoting/host/it2me/it2me_native_messaging_host.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/messaging/native_messaging_channel.h
diff --git a/chrome/browser/extensions/api/messaging/native_messaging_channel.h b/chrome/browser/extensions/api/messaging/native_messaging_channel.h
new file mode 100644
index 0000000000000000000000000000000000000000..995deacf2214bc0e73a13819569c72ce579aff6e
--- /dev/null
+++ b/chrome/browser/extensions/api/messaging/native_messaging_channel.h
@@ -0,0 +1,41 @@
+// Copyright 2013 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.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
+#define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
+
+#include "base/callback.h"
+
+namespace base {
+class DictionaryValue;
+class Value;
+} // namespace base
+
+namespace extensions {
+
+// Defines an interface to read messages and send responses between the native
+// process and chrome.
+class NativeMessagingChannel {
+ public:
+ // Used to send a message to the other endpoint.
+ typedef base::Callback<void(scoped_ptr<base::DictionaryValue> message)>
+ SendMessageCallback;
+
+ virtual ~NativeMessagingChannel() {}
+
+ // Starts reading and processing messages.
+ // |received_message| is called whenever a message is received from the other
+ // endpoint.
+ // |quit_closure| is called by the channel to shut down the native process
+ // whenever it encounter failures in sending or receiving a message.
+ virtual void Start(const SendMessageCallback& received_message,
+ const base::Closure& quit_closure) = 0;
+
+ // Sends a message to the other endpoint.
+ virtual void SendMessage(scoped_ptr<base::DictionaryValue> message) = 0;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
« no previous file with comments | « no previous file | remoting/host/DEPS » ('j') | remoting/host/it2me/it2me_native_messaging_host.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698