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

Side by Side Diff: base/memory/shared_memory_handle.h

Issue 2692273008: Hacky slashy (Closed)
Patch Set: wip Created 3 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_MEMORY_SHARED_MEMORY_HANDLE_H_ 5 #ifndef BASE_MEMORY_SHARED_MEMORY_HANDLE_H_
6 #define BASE_MEMORY_SHARED_MEMORY_HANDLE_H_ 6 #define BASE_MEMORY_SHARED_MEMORY_HANDLE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 11
12 #if defined(OS_WIN) 12 #if defined(OS_WIN)
13 #include <windows.h> 13 #include <windows.h>
14 #include "base/process/process_handle.h" 14 #include "base/process/process_handle.h"
15 #elif defined(OS_MACOSX) && !defined(OS_IOS) 15 #elif defined(OS_MACOSX) && !defined(OS_IOS)
16 #include <mach/mach.h> 16 #include <mach/mach.h>
17 #include "base/base_export.h" 17 #include "base/base_export.h"
18 #include "base/file_descriptor_posix.h" 18 #include "base/file_descriptor_posix.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "base/process/process_handle.h" 20 #include "base/process/process_handle.h"
21 #elif defined(OS_POSIX) 21 #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
22 #include <sys/types.h> 22 #include <sys/types.h>
23 #include "base/file_descriptor_posix.h" 23 #include "base/file_descriptor_posix.h"
24 #endif 24 #endif
25 25
26 namespace base { 26 namespace base {
27 27
28 // SharedMemoryHandle is a platform specific type which represents 28 // SharedMemoryHandle is a platform specific type which represents
29 // the underlying OS handle to a shared memory segment. 29 // the underlying OS handle to a shared memory segment.
30 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS)) 30 #if (defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS))) || \
31 defined(OS_FUCHSIA)
31 typedef FileDescriptor SharedMemoryHandle; 32 typedef FileDescriptor SharedMemoryHandle;
32 #elif defined(OS_WIN) 33 #elif defined(OS_WIN)
33 class BASE_EXPORT SharedMemoryHandle { 34 class BASE_EXPORT SharedMemoryHandle {
34 public: 35 public:
35 // The default constructor returns an invalid SharedMemoryHandle. 36 // The default constructor returns an invalid SharedMemoryHandle.
36 SharedMemoryHandle(); 37 SharedMemoryHandle();
37 SharedMemoryHandle(HANDLE h, base::ProcessId pid); 38 SharedMemoryHandle(HANDLE h, base::ProcessId pid);
38 39
39 // Standard copy constructor. The new instance shares the underlying OS 40 // Standard copy constructor. The new instance shares the underlying OS
40 // primitives. 41 // primitives.
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Defaults to |false|. 183 // Defaults to |false|.
183 bool ownership_passes_to_ipc_; 184 bool ownership_passes_to_ipc_;
184 }; 185 };
185 }; 186 };
186 }; 187 };
187 #endif 188 #endif
188 189
189 } // namespace base 190 } // namespace base
190 191
191 #endif // BASE_MEMORY_SHARED_MEMORY_HANDLE_H_ 192 #endif // BASE_MEMORY_SHARED_MEMORY_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698