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

Side by Side Diff: mojo/edk/embedder/platform_channel_pair_win.cc

Issue 633263002: Mojo: Combine mojo/edk/{system,embedder}/PRESUBMIT.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/embedder/PRESUBMIT.py ('k') | mojo/edk/system/PRESUBMIT.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mojo/edk/embedder/PRESUBMIT.py ('k') | mojo/edk/system/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698