| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ipc_util.h" | 5 #include "remoting/host/ipc_util.h" |
| 6 | 6 |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 &security_attributes, | 77 &security_attributes, |
| 78 OPEN_EXISTING, | 78 OPEN_EXISTING, |
| 79 SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION | | 79 SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION | |
| 80 FILE_FLAG_OVERLAPPED, | 80 FILE_FLAG_OVERLAPPED, |
| 81 nullptr)); | 81 nullptr)); |
| 82 if (!client.IsValid()) { | 82 if (!client.IsValid()) { |
| 83 PLOG(ERROR) << "Failed to connect to '" << pipe_name << "'"; | 83 PLOG(ERROR) << "Failed to connect to '" << pipe_name << "'"; |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| 86 | 86 |
| 87 *client_out = client.Pass(); | 87 *client_out = std::move(client); |
| 88 *server_out = server.Pass(); | 88 *server_out = std::move(server); |
| 89 return true; | 89 return true; |
| 90 } | 90 } |
| 91 | 91 |
| 92 bool CreateIpcChannel( | 92 bool CreateIpcChannel( |
| 93 const std::string& channel_name, | 93 const std::string& channel_name, |
| 94 const std::string& pipe_security_descriptor, | 94 const std::string& pipe_security_descriptor, |
| 95 base::win::ScopedHandle* pipe_out) { | 95 base::win::ScopedHandle* pipe_out) { |
| 96 // Create security descriptor for the channel. | 96 // Create security descriptor for the channel. |
| 97 ScopedSd sd = ConvertSddlToSd(pipe_security_descriptor); | 97 ScopedSd sd = ConvertSddlToSd(pipe_security_descriptor); |
| 98 if (!sd) { | 98 if (!sd) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 121 IPC::Channel::kReadBufferSize, | 121 IPC::Channel::kReadBufferSize, |
| 122 IPC::Channel::kReadBufferSize, | 122 IPC::Channel::kReadBufferSize, |
| 123 5000, | 123 5000, |
| 124 &security_attributes)); | 124 &security_attributes)); |
| 125 if (!pipe.IsValid()) { | 125 if (!pipe.IsValid()) { |
| 126 PLOG(ERROR) | 126 PLOG(ERROR) |
| 127 << "Failed to create the server end of the Chromoting IPC channel"; | 127 << "Failed to create the server end of the Chromoting IPC channel"; |
| 128 return false; | 128 return false; |
| 129 } | 129 } |
| 130 | 130 |
| 131 *pipe_out = pipe.Pass(); | 131 *pipe_out = std::move(pipe); |
| 132 return true; | 132 return true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace remoting | 135 } // namespace remoting |
| OLD | NEW |