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

Side by Side Diff: base/shared_memory.h

Issue 7184032: Upstream android file related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
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
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/21 18:44:02 I am still wondering why you need this method. If
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698