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

Side by Side Diff: base/memory/shared_memory_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/files/file_util_win.cc ('k') | base/process/kill_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/memory/shared_memory.h" 5 #include "base/memory/shared_memory.h"
6 6
7 #include <aclapi.h> 7 #include <aclapi.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 // static 80 // static
81 SharedMemoryHandle SharedMemory::NULLHandle() { 81 SharedMemoryHandle SharedMemory::NULLHandle() {
82 return NULL; 82 return NULL;
83 } 83 }
84 84
85 // static 85 // static
86 void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) { 86 void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) {
87 DCHECK(handle != NULL); 87 DCHECK(handle != NULL);
88 const BOOL result = ::CloseHandle(handle); 88 ::CloseHandle(handle);
89 CHECK(result);
90 } 89 }
91 90
92 // static 91 // static
93 size_t SharedMemory::GetHandleLimit() { 92 size_t SharedMemory::GetHandleLimit() {
94 // Rounded down from value reported here: 93 // Rounded down from value reported here:
95 // http://blogs.technet.com/b/markrussinovich/archive/2009/09/29/3283844.aspx 94 // http://blogs.technet.com/b/markrussinovich/archive/2009/09/29/3283844.aspx
96 return static_cast<size_t>(1 << 23); 95 return static_cast<size_t>(1 << 23);
97 } 96 }
98 97
99 // static 98 // static
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 CloseHandle(mapped_file_); 263 CloseHandle(mapped_file_);
265 mapped_file_ = NULL; 264 mapped_file_ = NULL;
266 } 265 }
267 } 266 }
268 267
269 SharedMemoryHandle SharedMemory::handle() const { 268 SharedMemoryHandle SharedMemory::handle() const {
270 return mapped_file_; 269 return mapped_file_;
271 } 270 }
272 271
273 } // namespace base 272 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_util_win.cc ('k') | base/process/kill_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698