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

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

Issue 1406123010: reland 2: Switch back to field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't use Mach on 10.6. Created 5 years, 1 month 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.h ('k') | base/memory/shared_memory_mac.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 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 "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 private: 68 private:
69 HANDLE handle_; 69 HANDLE handle_;
70 70
71 // The process in which |handle_| is valid and can be used. If |handle_| is 71 // The process in which |handle_| is valid and can be used. If |handle_| is
72 // invalid, this will be kNullProcessId. 72 // invalid, this will be kNullProcessId.
73 base::ProcessId pid_; 73 base::ProcessId pid_;
74 }; 74 };
75 #else 75 #else
76 class BASE_EXPORT SharedMemoryHandle { 76 class BASE_EXPORT SharedMemoryHandle {
77 public: 77 public:
78 // The values of these enums must not change, as they are used by the
79 // histogram OSX.SharedMemory.Mechanism.
78 enum Type { 80 enum Type {
79 // The SharedMemoryHandle is backed by a POSIX fd. 81 // The SharedMemoryHandle is backed by a POSIX fd.
80 POSIX, 82 POSIX,
81 // The SharedMemoryHandle is backed by the Mach primitive "memory object". 83 // The SharedMemoryHandle is backed by the Mach primitive "memory object".
82 MACH, 84 MACH,
83 }; 85 };
86 static const int TypeMax = 2;
84 87
85 // The format that should be used to transmit |Type| over the wire. 88 // The format that should be used to transmit |Type| over the wire.
86 typedef int TypeWireFormat; 89 typedef int TypeWireFormat;
87 90
88 // The default constructor returns an invalid SharedMemoryHandle. 91 // The default constructor returns an invalid SharedMemoryHandle.
89 SharedMemoryHandle(); 92 SharedMemoryHandle();
90 93
91 // Constructs a SharedMemoryHandle backed by the components of a 94 // Constructs a SharedMemoryHandle backed by the components of a
92 // FileDescriptor. The newly created instance has the same ownership semantics 95 // FileDescriptor. The newly created instance has the same ownership semantics
93 // as base::FileDescriptor. This typically means that the SharedMemoryHandle 96 // as base::FileDescriptor. This typically means that the SharedMemoryHandle
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // Defaults to |false|. 190 // Defaults to |false|.
188 bool ownership_passes_to_ipc_; 191 bool ownership_passes_to_ipc_;
189 }; 192 };
190 }; 193 };
191 }; 194 };
192 #endif 195 #endif
193 196
194 } // namespace base 197 } // namespace base
195 198
196 #endif // BASE_MEMORY_SHARED_MEMORY_HANDLE_H_ 199 #endif // BASE_MEMORY_SHARED_MEMORY_HANDLE_H_
OLDNEW
« no previous file with comments | « base/memory/shared_memory.h ('k') | base/memory/shared_memory_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698