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

Side by Side Diff: remoting/host/native_messaging/native_messaging_pipe.h

Issue 887853002: Shutdown the It2Me host cleanly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@it2me_host_dcheck
Patch Set: Created 5 years, 10 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_PIPE_H_ 5 #ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_PIPE_H_
6 #define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_PIPE_H_ 6 #define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_PIPE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "extensions/browser/api/messaging/native_message_host.h" 10 #include "extensions/browser/api/messaging/native_message_host.h"
11 #include "extensions/browser/api/messaging/native_messaging_channel.h" 11 #include "extensions/browser/api/messaging/native_messaging_channel.h"
12 12
13 namespace base { 13 namespace base {
14 class Value; 14 class Value;
15 } 15 }
16 16
17 namespace remoting { 17 namespace remoting {
18 18
19 // Connects a extensions::NativeMessageHost to a PipeMessagingChannel. 19 // Connects a extensions::NativeMessageHost to a PipeMessagingChannel.
20 class NativeMessagingPipe 20 class NativeMessagingPipe
21 : public extensions::NativeMessagingChannel::EventHandler, 21 : public extensions::NativeMessagingChannel::EventHandler,
22 public extensions::NativeMessageHost::Client { 22 public extensions::NativeMessageHost::Client {
23 public: 23 public:
24 NativeMessagingPipe(); 24 NativeMessagingPipe();
25 ~NativeMessagingPipe() override; 25 ~NativeMessagingPipe() override;
26 26
27 // Starts processing messages from the pipe. 27 // Starts processing messages from the pipe.
28 void Start(scoped_ptr<extensions::NativeMessageHost> host, 28 void Start(scoped_ptr<extensions::NativeMessageHost> host,
29 scoped_ptr<extensions::NativeMessagingChannel> channel, 29 scoped_ptr<extensions::NativeMessagingChannel> channel);
30 const base::Closure& quit_closure);
31 30
32 // extensions::NativeMessageHost::Client implementation. 31 // extensions::NativeMessageHost::Client implementation.
33 void PostMessageFromNativeHost(const std::string& message) override; 32 void PostMessageFromNativeHost(const std::string& message) override;
34 void CloseChannel(const std::string& error_message) override; 33 void CloseChannel(const std::string& error_message) override;
35 34
36 // extensions::NativeMessagingChannel::EventHandler implementation. 35 // extensions::NativeMessagingChannel::EventHandler implementation.
37 void OnMessage(scoped_ptr<base::Value> message) override; 36 void OnMessage(scoped_ptr<base::Value> message) override;
38 void OnDisconnect() override; 37 void OnDisconnect() override;
39 38
40 private: 39 private:
41 base::Closure quit_closure_;
42 scoped_ptr<extensions::NativeMessagingChannel> channel_; 40 scoped_ptr<extensions::NativeMessagingChannel> channel_;
43 scoped_ptr<extensions::NativeMessageHost> host_; 41 scoped_ptr<extensions::NativeMessageHost> host_;
44 42
45 DISALLOW_COPY_AND_ASSIGN(NativeMessagingPipe); 43 DISALLOW_COPY_AND_ASSIGN(NativeMessagingPipe);
46 }; 44 };
47 45
48 } // namespace remoting 46 } // namespace remoting
49 47
50 #endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_PIPE_H_ 48 #endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_PIPE_H_
OLDNEW
« no previous file with comments | « remoting/host/it2me/it2me_native_messaging_host_unittest.cc ('k') | remoting/host/native_messaging/native_messaging_pipe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698