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

Side by Side Diff: base/memory/shared_memory_mac.cc

Issue 2849633002: Get rid of base::SharedMemory::NULLHandle(); (Closed)
Patch Set: Rebase. Created 3 years, 7 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/memory/shared_memory_handle_win.cc ('k') | base/memory/shared_memory_nacl.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/memory/shared_memory.h" 5 #include "base/memory/shared_memory.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <mach/mach_vm.h> 8 #include <mach/mach_vm.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <sys/mman.h> 10 #include <sys/mman.h>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 Unmap(); 102 Unmap();
103 Close(); 103 Close();
104 } 104 }
105 105
106 // static 106 // static
107 bool SharedMemory::IsHandleValid(const SharedMemoryHandle& handle) { 107 bool SharedMemory::IsHandleValid(const SharedMemoryHandle& handle) {
108 return handle.IsValid(); 108 return handle.IsValid();
109 } 109 }
110 110
111 // static 111 // static
112 SharedMemoryHandle SharedMemory::NULLHandle() {
113 return SharedMemoryHandle();
114 }
115
116 // static
117 void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) { 112 void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) {
118 handle.Close(); 113 handle.Close();
119 } 114 }
120 115
121 // static 116 // static
122 size_t SharedMemory::GetHandleLimit() { 117 size_t SharedMemory::GetHandleLimit() {
123 return GetMaxFds(); 118 return GetMaxFds();
124 } 119 }
125 120
126 // static 121 // static
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 ShareMode share_mode) { 314 ShareMode share_mode) {
320 bool success = Share(new_handle, share_mode); 315 bool success = Share(new_handle, share_mode);
321 if (close_self) { 316 if (close_self) {
322 Unmap(); 317 Unmap();
323 Close(); 318 Close();
324 } 319 }
325 return success; 320 return success;
326 } 321 }
327 322
328 } // namespace base 323 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory_handle_win.cc ('k') | base/memory/shared_memory_nacl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698