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

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

Issue 2478443002: Use ChannelMojo for remote security key channels. (Closed)
Patch Set: Created 4 years, 1 month 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
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 e8b89aef16f6b05af7d92079fb3b815e65547d43..424ca2b6c76859790ecbb56007332eb974d155be 100644
--- a/remoting/host/security_key/security_key_ipc_constants.cc
+++ b/remoting/host/security_key/security_key_ipc_constants.cc
@@ -14,10 +14,10 @@
#endif // defined(OS_POSIX)
namespace {
-base::LazyInstance<std::string> g_security_key_ipc_channel_name =
- LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<mojo::edk::NamedPlatformHandle>
+ g_security_key_ipc_channel_name = LAZY_INSTANCE_INITIALIZER;
-const char kSecurityKeyIpcChannelName[] = "security_key_ipc_channel";
+constexpr char kSecurityKeyIpcChannelName[] = "security_key_ipc_channel";
} // namespace
@@ -25,16 +25,18 @@ namespace remoting {
const char kSecurityKeyConnectionError[] = "ssh_connection_error";
-const std::string& GetSecurityKeyIpcChannelName() {
- if (g_security_key_ipc_channel_name.Get().empty()) {
- g_security_key_ipc_channel_name.Get() = kSecurityKeyIpcChannelName;
+const mojo::edk::NamedPlatformHandle& GetSecurityKeyIpcChannel() {
+ if (!g_security_key_ipc_channel_name.Get().is_valid()) {
+ g_security_key_ipc_channel_name.Get() =
+ mojo::edk::NamedPlatformHandle(kSecurityKeyIpcChannelName);
}
return g_security_key_ipc_channel_name.Get();
}
-void SetSecurityKeyIpcChannelNameForTest(const std::string& channel_name) {
- g_security_key_ipc_channel_name.Get() = channel_name;
+void SetSecurityKeyIpcChannelForTest(
+ const mojo::edk::NamedPlatformHandle& channel_handle) {
+ g_security_key_ipc_channel_name.Get() = channel_handle;
}
std::string GetChannelNamePathPrefixForTest() {
« no previous file with comments | « remoting/host/security_key/security_key_ipc_constants.h ('k') | remoting/host/security_key/security_key_ipc_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698