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 #include "remoting/host/security_key/remote_security_key_ipc_server.h" | 5 #include "remoting/host/security_key/security_key_ipc_server.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
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/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 #include "ipc/ipc_channel.h" | 15 #include "ipc/ipc_channel.h" |
16 #include "ipc/ipc_message.h" | 16 #include "ipc/ipc_message.h" |
17 #include "ipc/ipc_message_macros.h" | 17 #include "ipc/ipc_message_macros.h" |
18 #include "remoting/base/logging.h" | 18 #include "remoting/base/logging.h" |
19 #include "remoting/host/chromoting_messages.h" | 19 #include "remoting/host/chromoting_messages.h" |
20 #include "remoting/host/security_key/remote_security_key_ipc_server_impl.h" | 20 #include "remoting/host/security_key/security_key_ipc_server_impl.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // Not thread safe, tests which set this value must do so on the same thread. | 24 // Not thread safe, tests which set this value must do so on the same thread. |
25 static remoting::RemoteSecurityKeyIpcServerFactory* g_factory = nullptr; | 25 static remoting::SecurityKeyIpcServerFactory* g_factory = nullptr; |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 namespace remoting { | 29 namespace remoting { |
30 | 30 |
31 void RemoteSecurityKeyIpcServer::SetFactoryForTest( | 31 void SecurityKeyIpcServer::SetFactoryForTest( |
32 RemoteSecurityKeyIpcServerFactory* factory) { | 32 SecurityKeyIpcServerFactory* factory) { |
33 g_factory = factory; | 33 g_factory = factory; |
34 } | 34 } |
35 | 35 |
36 std::unique_ptr<RemoteSecurityKeyIpcServer> RemoteSecurityKeyIpcServer::Create( | 36 std::unique_ptr<SecurityKeyIpcServer> SecurityKeyIpcServer::Create( |
37 int connection_id, | 37 int connection_id, |
38 uint32_t peer_session_id, | 38 uint32_t peer_session_id, |
39 base::TimeDelta initial_connect_timeout, | 39 base::TimeDelta initial_connect_timeout, |
40 const GnubbyAuthHandler::SendMessageCallback& message_callback, | 40 const SecurityKeyAuthHandler::SendMessageCallback& message_callback, |
41 const base::Closure& done_callback) { | 41 const base::Closure& done_callback) { |
42 std::unique_ptr<RemoteSecurityKeyIpcServer> ipc_server = | 42 std::unique_ptr<SecurityKeyIpcServer> ipc_server = |
43 g_factory | 43 g_factory |
44 ? g_factory->Create(connection_id, peer_session_id, | 44 ? g_factory->Create(connection_id, peer_session_id, |
45 initial_connect_timeout, message_callback, | 45 initial_connect_timeout, message_callback, |
46 done_callback) | 46 done_callback) |
47 : base::WrapUnique(new RemoteSecurityKeyIpcServerImpl( | 47 : base::WrapUnique(new SecurityKeyIpcServerImpl( |
48 connection_id, peer_session_id, initial_connect_timeout, | 48 connection_id, peer_session_id, initial_connect_timeout, |
49 message_callback, done_callback)); | 49 message_callback, done_callback)); |
50 | 50 |
51 return ipc_server; | 51 return ipc_server; |
52 } | 52 } |
53 | 53 |
54 } // namespace remoting | 54 } // namespace remoting |
OLD | NEW |