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

Unified Diff: base/memory/shared_memory.h

Issue 1167863002: Remove unused locking functionality from base::SharedMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared_memory_remove_abtest
Patch Set: Remove constant from android translation unit. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/memory/shared_memory_nacl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory.h
diff --git a/base/memory/shared_memory.h b/base/memory/shared_memory.h
index 008bb0106688c56f66e7edea893de42b5c5c0f5a..68db65c2f3221c9419de0b86ae6f6469d9bb18d1 100644
--- a/base/memory/shared_memory.h
+++ b/base/memory/shared_memory.h
@@ -257,27 +257,11 @@ class BASE_EXPORT SharedMemory {
return ShareToProcessCommon(process, new_handle, true, SHARE_CURRENT_MODE);
}
- // DEPRECATED (crbug.com/345734):
- // Locks the shared memory.
- //
- // WARNING: on POSIX the memory locking primitive only works across
- // processes, not across threads. The LockDeprecated method is not currently
- // used in inner loops, so we protect against multiple threads in a
- // critical section using a class global lock.
- void LockDeprecated();
-
- // DEPRECATED (crbug.com/345734):
- // Releases the shared memory lock.
- void UnlockDeprecated();
-
private:
-#if defined(OS_POSIX) && !defined(OS_NACL)
-#if !defined(OS_ANDROID)
+#if defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_ANDROID)
bool PrepareMapFile(ScopedFILE fp, ScopedFD readonly);
bool FilePathForMemoryName(const std::string& mem_name, FilePath* path);
-#endif
- void LockOrUnlockCommon(int function);
-#endif // defined(OS_POSIX) && !defined(OS_NACL)
+#endif // defined(OS_POSIX) && !defined(OS_NACL) && !defined(OS_ANDROID)
enum ShareMode {
SHARE_READONLY,
SHARE_CURRENT_MODE,
@@ -298,32 +282,9 @@ class BASE_EXPORT SharedMemory {
void* memory_;
bool read_only_;
size_t requested_size_;
-#if !defined(OS_POSIX)
- HANDLE lock_;
-#endif
DISALLOW_COPY_AND_ASSIGN(SharedMemory);
};
-
-// DEPRECATED (crbug.com/345734):
-// A helper class that acquires the shared memory lock while
-// the SharedMemoryAutoLockDeprecated is in scope.
-class SharedMemoryAutoLockDeprecated {
- public:
- explicit SharedMemoryAutoLockDeprecated(SharedMemory* shared_memory)
- : shared_memory_(shared_memory) {
- shared_memory_->LockDeprecated();
- }
-
- ~SharedMemoryAutoLockDeprecated() {
- shared_memory_->UnlockDeprecated();
- }
-
- private:
- SharedMemory* shared_memory_;
- DISALLOW_COPY_AND_ASSIGN(SharedMemoryAutoLockDeprecated);
-};
-
} // namespace base
#endif // BASE_MEMORY_SHARED_MEMORY_H_
« no previous file with comments | « no previous file | base/memory/shared_memory_nacl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698