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