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

Side by Side 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: Include cleanups 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
Sergey Ulanov 2014/09/15 19:53:39 I think it's better to add this file under extensi
kelvinp 2014/09/16 00:32:51 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
7
8 #include "base/callback.h"
9
10 namespace base {
11 class DictionaryValue;
12 } // namespace base
13
14 namespace extensions {
15
16 // Defines an interface to read messages and send responses between a native
17 // component and chrome.
18 class NativeMessagingChannel {
19 public:
20 // Used to send a message to the other endpoint.
21 typedef base::Callback<void(scoped_ptr<base::DictionaryValue> message)>
Sergey Ulanov 2014/09/15 19:53:39 this should be base::Value instead of DictionaryVa
kelvinp 2014/09/16 00:32:51 Done.
22 SendMessageCallback;
23
24 virtual ~NativeMessagingChannel() {}
25
26 // Starts reading and processing messages.
27 // |received_message| is called whenever a message is received from the other
28 // endpoint.
29 // |quit_closure| is called by the channel to shut down the native component
30 // whenever it encounter failures in sending or receiving a message.
31 virtual void Start(const SendMessageCallback& received_message,
Sergey Ulanov 2014/09/15 19:53:39 I suggest you replace these two callbacks with a c
kelvinp 2014/09/16 00:32:51 Done.
32 const base::Closure& quit_closure) = 0;
33
34 // Sends a message to the other endpoint.
35 virtual void SendMessage(scoped_ptr<base::DictionaryValue> message) = 0;
Sergey Ulanov 2014/09/15 19:53:39 base::Value
kelvinp 2014/09/16 00:32:51 Done.
36 };
37
38 } // namespace extensions
39
40 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/host/DEPS » ('j') | remoting/host/native_messaging/pipe_messaging_channel.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698