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

Side by Side Diff: base/sync_socket_win.cc

Issue 593113004: Remove implicit HANDLE conversions from base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 | « base/message_loop/message_pump_win.cc ('k') | base/test/test_file_util_win.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/sync_socket.h" 5 #include "base/sync_socket.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/threading/thread_restrictions.h" 8 #include "base/threading/thread_restrictions.h"
9 #include "base/win/scoped_handle.h" 9 #include "base/win/scoped_handle.h"
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 0, // no sharing. 78 0, // no sharing.
79 NULL, // default security attributes. 79 NULL, // default security attributes.
80 OPEN_EXISTING, // opens existing pipe. 80 OPEN_EXISTING, // opens existing pipe.
81 flags, 81 flags,
82 NULL)); // no template file. 82 NULL)); // no template file.
83 if (!handle_b.IsValid()) { 83 if (!handle_b.IsValid()) {
84 DPLOG(ERROR) << "CreateFileW failed"; 84 DPLOG(ERROR) << "CreateFileW failed";
85 return false; 85 return false;
86 } 86 }
87 87
88 if (!ConnectNamedPipe(handle_a, NULL)) { 88 if (!ConnectNamedPipe(handle_a.Get(), NULL)) {
89 DWORD error = GetLastError(); 89 DWORD error = GetLastError();
90 if (error != ERROR_PIPE_CONNECTED) { 90 if (error != ERROR_PIPE_CONNECTED) {
91 DPLOG(ERROR) << "ConnectNamedPipe failed"; 91 DPLOG(ERROR) << "ConnectNamedPipe failed";
92 return false; 92 return false;
93 } 93 }
94 } 94 }
95 95
96 *socket_a = handle_a.Take(); 96 *socket_a = handle_a.Take();
97 *socket_b = handle_b.Take(); 97 *socket_b = handle_b.Take();
98 98
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 &file_operation_, &shutdown_event_, this, timeout.InMilliseconds()); 331 &file_operation_, &shutdown_event_, this, timeout.InMilliseconds());
332 } 332 }
333 333
334 // static 334 // static
335 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, 335 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
336 CancelableSyncSocket* socket_b) { 336 CancelableSyncSocket* socket_b) {
337 return CreatePairImpl(&socket_a->handle_, &socket_b->handle_, true); 337 return CreatePairImpl(&socket_a->handle_, &socket_b->handle_, true);
338 } 338 }
339 339
340 } // namespace base 340 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_win.cc ('k') | base/test/test_file_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698