OLD | NEW |
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 #ifndef BASE_SHARED_MEMORY_H_ | 5 #ifndef BASE_SHARED_MEMORY_H_ |
6 #define BASE_SHARED_MEMORY_H_ | 6 #define BASE_SHARED_MEMORY_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #if defined(OS_POSIX) | 12 #if defined(OS_POSIX) |
13 #include <stdio.h> | 13 #include <stdio.h> |
14 #include <sys/types.h> | 14 #include <sys/types.h> |
15 #include <semaphore.h> | 15 #include <semaphore.h> |
16 #endif | 16 #endif |
17 | 17 |
18 #include "base/base_export.h" | 18 #include "base/base_export.h" |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/process.h" | 20 #include "base/process.h" |
21 | 21 |
22 #if defined(OS_POSIX) | 22 #if defined(OS_POSIX) |
23 #include "base/file_descriptor_posix.h" | 23 #include "base/file_descriptor_posix.h" |
24 #endif | 24 #endif |
25 | 25 |
| 26 namespace base { |
| 27 |
26 class FilePath; | 28 class FilePath; |
27 | 29 |
28 namespace base { | |
29 | |
30 // SharedMemoryHandle is a platform specific type which represents | 30 // SharedMemoryHandle is a platform specific type which represents |
31 // the underlying OS handle to a shared memory segment. | 31 // the underlying OS handle to a shared memory segment. |
32 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
33 typedef HANDLE SharedMemoryHandle; | 33 typedef HANDLE SharedMemoryHandle; |
34 typedef HANDLE SharedMemoryLock; | 34 typedef HANDLE SharedMemoryLock; |
35 #elif defined(OS_POSIX) | 35 #elif defined(OS_POSIX) |
36 // A SharedMemoryId is sufficient to identify a given shared memory segment on a | 36 // A SharedMemoryId is sufficient to identify a given shared memory segment on a |
37 // system, but insufficient to map it. | 37 // system, but insufficient to map it. |
38 typedef FileDescriptor SharedMemoryHandle; | 38 typedef FileDescriptor SharedMemoryHandle; |
39 typedef ino_t SharedMemoryId; | 39 typedef ino_t SharedMemoryId; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 } | 273 } |
274 | 274 |
275 private: | 275 private: |
276 SharedMemory* shared_memory_; | 276 SharedMemory* shared_memory_; |
277 DISALLOW_COPY_AND_ASSIGN(SharedMemoryAutoLock); | 277 DISALLOW_COPY_AND_ASSIGN(SharedMemoryAutoLock); |
278 }; | 278 }; |
279 | 279 |
280 } // namespace base | 280 } // namespace base |
281 | 281 |
282 #endif // BASE_SHARED_MEMORY_H_ | 282 #endif // BASE_SHARED_MEMORY_H_ |
OLD | NEW |