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

Unified Diff: remoting/host/security_key/security_key_ipc_constants.cc

Issue 2161013003: Changing the default path for RemoteSecurityKeyIpcServer test channels (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rename
Patch Set: Addressing feedback Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/security_key/security_key_ipc_constants.cc
diff --git a/remoting/host/security_key/security_key_ipc_constants.cc b/remoting/host/security_key/security_key_ipc_constants.cc
index e9aeb8685750951c6d5d1ea5598e9240d23c27da..4c70453a28149f3a237ca26063f58d1f7bb59bbf 100644
--- a/remoting/host/security_key/security_key_ipc_constants.cc
+++ b/remoting/host/security_key/security_key_ipc_constants.cc
@@ -4,8 +4,10 @@
#include "remoting/host/security_key/security_key_ipc_constants.h"
-#include "base/environment.h"
+#include "base/files/file_path.h"
+#include "base/files/file_util.h"
#include "base/lazy_instance.h"
+#include "base/macros.h"
Lei Zhang 2016/07/19 22:55:04 It's great that you are trying to IWYU, but what i
joedow 2016/07/19 23:04:12 Done.
namespace {
base::LazyInstance<std::string> g_security_key_ipc_channel_name =
@@ -17,7 +19,7 @@ const char kSecurityKeyIpcChannelName[] = "security_key_ipc_channel";
namespace remoting {
-extern const char kSecurityKeyConnectionError[] = "ssh_connection_error";
+const char kSecurityKeyConnectionError[] = "ssh_connection_error";
const std::string& GetSecurityKeyIpcChannelName() {
if (g_security_key_ipc_channel_name.Get().empty()) {
@@ -32,14 +34,16 @@ void SetSecurityKeyIpcChannelNameForTest(const std::string& channel_name) {
}
std::string GetChannelNamePathPrefixForTest() {
- std::string path_prefix;
-#if defined(OS_LINUX)
- path_prefix = "/dev/socket/";
- std::unique_ptr<base::Environment> env(base::Environment::Create());
- if (env->GetVar(base::env_vars::kHome, &path_prefix))
- path_prefix += "/";
+ std::string base_path;
+#if defined(OS_POSIX)
+ base::FilePath base_file_path;
+ if (!base::GetTempDir(&base_file_path)) {
+ LOG(ERROR) << "Failed to retrieve temporary directory.";
+ } else {
+ base_path = base_file_path.value() + "/";
+ }
#endif
- return path_prefix;
+ return base_path;
}
} // namespace remoting
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698