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 <stdio.h> |
6 | 6 #include <sys/errno.h> |
7 #include <errno.h> | 7 #include <sys/fcntl.h> |
8 #include <fcntl.h> | |
9 #include <sys/mman.h> | 8 #include <sys/mman.h> |
10 #include <sys/stat.h> | 9 #include <sys/stat.h> |
11 #include <unistd.h> | 10 #include <unistd.h> |
| 11 #include <string> |
12 | 12 |
| 13 #include "base/basictypes.h" |
| 14 #include "base/file_descriptor_posix.h" |
| 15 #include "base/file_path.h" |
13 #include "base/file_util.h" | 16 #include "base/file_util.h" |
14 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/process.h" |
| 19 #include "base/safe_strerror_posix.h" |
| 20 #include "base/shared_memory.h" |
| 21 #include "base/string_piece.h" |
15 #include "base/threading/platform_thread.h" | 22 #include "base/threading/platform_thread.h" |
16 #include "base/safe_strerror_posix.h" | |
17 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
18 #include "base/utf_string_conversions.h" | 24 #include "build/build_config.h" |
19 | 25 |
20 namespace base { | 26 namespace base { |
21 | 27 |
22 namespace { | 28 namespace { |
23 // Paranoia. Semaphores and shared memory segments should live in different | 29 // Paranoia. Semaphores and shared memory segments should live in different |
24 // namespaces, but who knows what's out there. | 30 // namespaces, but who knows what's out there. |
25 const char kSemaphoreSuffix[] = "-sem"; | 31 const char kSemaphoreSuffix[] = "-sem"; |
26 } | 32 } |
27 | 33 |
28 SharedMemory::SharedMemory() | 34 SharedMemory::SharedMemory() |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 new_handle->fd = new_fd; | 322 new_handle->fd = new_fd; |
317 new_handle->auto_close = true; | 323 new_handle->auto_close = true; |
318 | 324 |
319 if (close_self) | 325 if (close_self) |
320 Close(); | 326 Close(); |
321 | 327 |
322 return true; | 328 return true; |
323 } | 329 } |
324 | 330 |
325 } // namespace base | 331 } // namespace base |
OLD | NEW |