OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/edk/embedder/platform_channel_pair.h" | 5 #include "mojo/edk/embedder/platform_channel_pair.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 5000, // Timeout in milliseconds. | 46 5000, // Timeout in milliseconds. |
47 nullptr))); // Default security descriptor. | 47 nullptr))); // Default security descriptor. |
48 PCHECK(server_handle_.is_valid()); | 48 PCHECK(server_handle_.is_valid()); |
49 | 49 |
50 const DWORD kDesiredAccess = GENERIC_READ | GENERIC_WRITE; | 50 const DWORD kDesiredAccess = GENERIC_READ | GENERIC_WRITE; |
51 // The SECURITY_ANONYMOUS flag means that the server side cannot impersonate | 51 // The SECURITY_ANONYMOUS flag means that the server side cannot impersonate |
52 // the client. | 52 // the client. |
53 const DWORD kFlags = | 53 const DWORD kFlags = |
54 SECURITY_SQOS_PRESENT | SECURITY_ANONYMOUS | FILE_FLAG_OVERLAPPED; | 54 SECURITY_SQOS_PRESENT | SECURITY_ANONYMOUS | FILE_FLAG_OVERLAPPED; |
55 // Allow the handle to be inherited by child processes. | 55 // Allow the handle to be inherited by child processes. |
56 SECURITY_ATTRIBUTES security_attributes = {sizeof(SECURITY_ATTRIBUTES), | 56 SECURITY_ATTRIBUTES security_attributes = { |
57 nullptr, TRUE}; | 57 sizeof(SECURITY_ATTRIBUTES), nullptr, TRUE}; |
58 client_handle_.reset( | 58 client_handle_.reset( |
59 PlatformHandle(CreateFileW(pipe_name.c_str(), | 59 PlatformHandle(CreateFileW(pipe_name.c_str(), |
60 kDesiredAccess, | 60 kDesiredAccess, |
61 0, // No sharing. | 61 0, // No sharing. |
62 &security_attributes, | 62 &security_attributes, |
63 OPEN_EXISTING, | 63 OPEN_EXISTING, |
64 kFlags, | 64 kFlags, |
65 nullptr))); // No template file. | 65 nullptr))); // No template file. |
66 PCHECK(client_handle_.is_valid()); | 66 PCHECK(client_handle_.is_valid()); |
67 | 67 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 << command_line->GetSwitchValueASCII(kMojoPlatformChannelHandleSwitch); | 108 << command_line->GetSwitchValueASCII(kMojoPlatformChannelHandleSwitch); |
109 // (Any existing switch won't actually be removed from the command line, but | 109 // (Any existing switch won't actually be removed from the command line, but |
110 // the last one appended takes precedence.) | 110 // the last one appended takes precedence.) |
111 command_line->AppendSwitchASCII( | 111 command_line->AppendSwitchASCII( |
112 kMojoPlatformChannelHandleSwitch, | 112 kMojoPlatformChannelHandleSwitch, |
113 base::IntToString(HandleToLong(client_handle_.get().handle))); | 113 base::IntToString(HandleToLong(client_handle_.get().handle))); |
114 } | 114 } |
115 | 115 |
116 } // namespace embedder | 116 } // namespace embedder |
117 } // namespace mojo | 117 } // namespace mojo |
OLD | NEW |