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

Side by Side Diff: base/sync_socket_win.cc

Issue 1356743003: Revert of Check for CloseHandle failures even when not debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/sync_socket_unittest.cc ('k') | base/threading/platform_thread_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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 DPLOG(ERROR) << "Cannot duplicate socket handle for peer process."; 228 DPLOG(ERROR) << "Cannot duplicate socket handle for peer process.";
229 return false; 229 return false;
230 } 230 }
231 return true; 231 return true;
232 } 232 }
233 233
234 bool SyncSocket::Close() { 234 bool SyncSocket::Close() {
235 if (handle_ == kInvalidHandle) 235 if (handle_ == kInvalidHandle)
236 return true; 236 return true;
237 237
238 const BOOL result = ::CloseHandle(handle_); 238 const BOOL result = CloseHandle(handle_);
239 CHECK(result);
240 handle_ = kInvalidHandle; 239 handle_ = kInvalidHandle;
241 return result == TRUE; 240 return result == TRUE;
242 } 241 }
243 242
244 size_t SyncSocket::Send(const void* buffer, size_t length) { 243 size_t SyncSocket::Send(const void* buffer, size_t length) {
245 ThreadRestrictions::AssertIOAllowed(); 244 ThreadRestrictions::AssertIOAllowed();
246 DCHECK_GT(length, 0u); 245 DCHECK_GT(length, 0u);
247 DCHECK_LE(length, kMaxMessageLength); 246 DCHECK_LE(length, kMaxMessageLength);
248 DCHECK_NE(handle_, kInvalidHandle); 247 DCHECK_NE(handle_, kInvalidHandle);
249 size_t count = 0; 248 size_t count = 0;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 static_cast<DWORD>(timeout.InMilliseconds())); 333 static_cast<DWORD>(timeout.InMilliseconds()));
335 } 334 }
336 335
337 // static 336 // static
338 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a, 337 bool CancelableSyncSocket::CreatePair(CancelableSyncSocket* socket_a,
339 CancelableSyncSocket* socket_b) { 338 CancelableSyncSocket* socket_b) {
340 return CreatePairImpl(&socket_a->handle_, &socket_b->handle_, true); 339 return CreatePairImpl(&socket_a->handle_, &socket_b->handle_, true);
341 } 340 }
342 341
343 } // namespace base 342 } // namespace base
OLDNEW
« no previous file with comments | « base/sync_socket_unittest.cc ('k') | base/threading/platform_thread_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698