OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SECURITY_KEY_REMOTE_SECURITY_KEY_IPC_CLIENT_H_ | 5 #ifndef REMOTING_HOST_SECURITY_KEY_SECURITY_KEY_IPC_CLIENT_H_ |
6 #define REMOTING_HOST_SECURITY_KEY_REMOTE_SECURITY_KEY_IPC_CLIENT_H_ | 6 #define REMOTING_HOST_SECURITY_KEY_SECURITY_KEY_IPC_CLIENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
14 #include "ipc/ipc_listener.h" | 14 #include "ipc/ipc_listener.h" |
15 | 15 |
16 namespace IPC { | 16 namespace IPC { |
17 class Channel; | 17 class Channel; |
18 class Message; | 18 class Message; |
19 } // IPC | 19 } // IPC |
20 | 20 |
21 namespace remoting { | 21 namespace remoting { |
22 | 22 |
23 // Responsible for handing the client end of the IPC channel between the | 23 // Responsible for handing the client end of the IPC channel between the |
24 // the network process (server) and remote_security_key process (client). | 24 // the network process (server) and remote_security_key process (client). |
25 // The public methods are virtual to allow for using fake objects for testing. | 25 // The public methods are virtual to allow for using fake objects for testing. |
26 class RemoteSecurityKeyIpcClient : public IPC::Listener { | 26 class SecurityKeyIpcClient : public IPC::Listener { |
27 public: | 27 public: |
28 RemoteSecurityKeyIpcClient(); | 28 SecurityKeyIpcClient(); |
29 ~RemoteSecurityKeyIpcClient() override; | 29 ~SecurityKeyIpcClient() override; |
30 | 30 |
31 // Used to send gnubby extension messages to the client. | 31 // Used to send security key extension messages to the client. |
32 typedef base::Callback<void(const std::string& response_data)> | 32 typedef base::Callback<void(const std::string& response_data)> |
33 ResponseCallback; | 33 ResponseCallback; |
34 | 34 |
35 // Returns true if there is an active remoting session which supports | 35 // Returns true if there is an active remoting session which supports |
36 // security key request forwarding. | 36 // security key request forwarding. |
37 virtual bool WaitForSecurityKeyIpcServerChannel(); | 37 virtual bool WaitForSecurityKeyIpcServerChannel(); |
38 | 38 |
39 // Begins the process of connecting to the IPC channel which will be used for | 39 // Begins the process of connecting to the IPC channel which will be used for |
40 // exchanging security key messages. | 40 // exchanging security key messages. |
41 // |connection_ready_callback| is called when a channel has been established | 41 // |connection_ready_callback| is called when a channel has been established |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 base::Closure connection_error_callback_; | 95 base::Closure connection_error_callback_; |
96 | 96 |
97 // Signaled when a security key response has been received. | 97 // Signaled when a security key response has been received. |
98 ResponseCallback response_callback_; | 98 ResponseCallback response_callback_; |
99 | 99 |
100 // Used for sending/receiving security key messages between processes. | 100 // Used for sending/receiving security key messages between processes. |
101 std::unique_ptr<IPC::Channel> ipc_channel_; | 101 std::unique_ptr<IPC::Channel> ipc_channel_; |
102 | 102 |
103 base::ThreadChecker thread_checker_; | 103 base::ThreadChecker thread_checker_; |
104 | 104 |
105 base::WeakPtrFactory<RemoteSecurityKeyIpcClient> weak_factory_; | 105 base::WeakPtrFactory<SecurityKeyIpcClient> weak_factory_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(RemoteSecurityKeyIpcClient); | 107 DISALLOW_COPY_AND_ASSIGN(SecurityKeyIpcClient); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace remoting | 110 } // namespace remoting |
111 | 111 |
112 #endif // REMOTING_HOST_SECURITY_KEY_REMOTE_SECURITY_KEY_IPC_CLIENT_H_ | 112 #endif // REMOTING_HOST_SECURITY_KEY_SECURITY_KEY_IPC_CLIENT_H_ |
OLD | NEW |