OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 // A Lock() implementation with a timeout that also allows setting | 177 // A Lock() implementation with a timeout that also allows setting |
178 // security attributes on the mutex. sec_attr may be NULL. | 178 // security attributes on the mutex. sec_attr may be NULL. |
179 // Returns true if the Lock() has been acquired, false if the timeout was | 179 // Returns true if the Lock() has been acquired, false if the timeout was |
180 // reached. | 180 // reached. |
181 bool Lock(uint32 timeout_ms, SECURITY_ATTRIBUTES* sec_attr); | 181 bool Lock(uint32 timeout_ms, SECURITY_ATTRIBUTES* sec_attr); |
182 #endif | 182 #endif |
183 | 183 |
184 // Releases the shared memory lock. | 184 // Releases the shared memory lock. |
185 void Unlock(); | 185 void Unlock(); |
186 | 186 |
187 #if defined(OS_ANDROID) | |
188 // Returns the size of shared memory or a negative value on error. | |
189 int GetAshmenSizeRegion(); | |
darin (slow to review)
2011/06/20 18:44:01
Is "Asmen" a common word on Android? It is good t
michaelbai
2011/06/20 22:50:36
I think created_size() is just for one who created
| |
190 #endif | |
191 | |
187 private: | 192 private: |
188 #if defined(OS_POSIX) | 193 #if defined(OS_POSIX) |
189 bool PrepareMapFile(FILE *fp); | 194 bool PrepareMapFile(FILE *fp); |
190 bool FilePathForMemoryName(const std::string& mem_name, FilePath* path); | 195 bool FilePathForMemoryName(const std::string& mem_name, FilePath* path); |
191 void LockOrUnlockCommon(int function); | 196 void LockOrUnlockCommon(int function); |
192 #endif | 197 #endif |
193 bool ShareToProcessCommon(ProcessHandle process, | 198 bool ShareToProcessCommon(ProcessHandle process, |
194 SharedMemoryHandle* new_handle, | 199 SharedMemoryHandle* new_handle, |
195 bool close_self); | 200 bool close_self); |
196 | 201 |
(...skipping 29 matching lines...) Expand all Loading... | |
226 } | 231 } |
227 | 232 |
228 private: | 233 private: |
229 SharedMemory* shared_memory_; | 234 SharedMemory* shared_memory_; |
230 DISALLOW_COPY_AND_ASSIGN(SharedMemoryAutoLock); | 235 DISALLOW_COPY_AND_ASSIGN(SharedMemoryAutoLock); |
231 }; | 236 }; |
232 | 237 |
233 } // namespace base | 238 } // namespace base |
234 | 239 |
235 #endif // BASE_SHARED_MEMORY_H_ | 240 #endif // BASE_SHARED_MEMORY_H_ |
OLD | NEW |