| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/shared_memory.h" | 5 #include "base/shared_memory.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <sys/mman.h> | 9 #include <sys/mman.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| 11 #include <unistd.h> | 11 #include <unistd.h> |
| 12 | 12 |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/threading/platform_thread.h" | 15 #include "base/threading/platform_thread.h" |
| 16 #include "base/safe_strerror_posix.h" | 16 #include "base/safe_strerror_posix.h" |
| 17 #include "base/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 // Paranoia. Semaphores and shared memory segments should live in different | 23 // Paranoia. Semaphores and shared memory segments should live in different |
| 24 // namespaces, but who knows what's out there. | 24 // namespaces, but who knows what's out there. |
| 25 const char kSemaphoreSuffix[] = "-sem"; | 25 const char kSemaphoreSuffix[] = "-sem"; |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 317 |
| 318 void SharedMemory::Unlock() { | 318 void SharedMemory::Unlock() { |
| 319 LockOrUnlockCommon(F_ULOCK); | 319 LockOrUnlockCommon(F_ULOCK); |
| 320 } | 320 } |
| 321 | 321 |
| 322 SharedMemoryHandle SharedMemory::handle() const { | 322 SharedMemoryHandle SharedMemory::handle() const { |
| 323 return FileDescriptor(mapped_file_, false); | 323 return FileDescriptor(mapped_file_, false); |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // namespace base | 326 } // namespace base |
| OLD | NEW |