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_constants.h" | 5 #include "remoting/host/security_key/remote_security_key_ipc_constants.h" |
6 | 6 |
| 7 #include "base/environment.h" |
7 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
8 | 9 |
9 namespace { | 10 namespace { |
10 base::LazyInstance<std::string> g_remote_security_key_ipc_channel_name = | 11 base::LazyInstance<std::string> g_remote_security_key_ipc_channel_name = |
11 LAZY_INSTANCE_INITIALIZER; | 12 LAZY_INSTANCE_INITIALIZER; |
12 | 13 |
13 const char kRemoteSecurityKeyIpcChannelName[] = | 14 const char kRemoteSecurityKeyIpcChannelName[] = |
14 "remote_security_key_ipc_channel"; | 15 "remote_security_key_ipc_channel"; |
15 | 16 |
16 } // namespace | 17 } // namespace |
(...skipping 10 matching lines...) Expand all Loading... |
27 } | 28 } |
28 | 29 |
29 return g_remote_security_key_ipc_channel_name.Get(); | 30 return g_remote_security_key_ipc_channel_name.Get(); |
30 } | 31 } |
31 | 32 |
32 void SetRemoteSecurityKeyIpcChannelNameForTest( | 33 void SetRemoteSecurityKeyIpcChannelNameForTest( |
33 const std::string& channel_name) { | 34 const std::string& channel_name) { |
34 g_remote_security_key_ipc_channel_name.Get() = channel_name; | 35 g_remote_security_key_ipc_channel_name.Get() = channel_name; |
35 } | 36 } |
36 | 37 |
| 38 std::string GetChannelNamePathPrefixForTest() { |
| 39 std::string path_prefix; |
| 40 #if defined(OS_LINUX) |
| 41 path_prefix = "/dev/socket/"; |
| 42 std::unique_ptr<base::Environment> env(base::Environment::Create()); |
| 43 if (env->GetVar(base::env_vars::kHome, &path_prefix)) |
| 44 path_prefix += "/"; |
| 45 #endif |
| 46 return path_prefix; |
| 47 } |
| 48 |
37 } // namespace remoting | 49 } // namespace remoting |
OLD | NEW |