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

Unified Diff: base/memory/shared_memory_win.cc

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 | « base/memory/shared_memory_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_win.cc
diff --git a/base/memory/shared_memory_win.cc b/base/memory/shared_memory_win.cc
index eacf0d6ccefcd97bd42d6758d4c99597d41f1730..b1f85da93356c895de4d03753ab83589f31d19da 100644
--- a/base/memory/shared_memory_win.cc
+++ b/base/memory/shared_memory_win.cc
@@ -32,8 +32,7 @@ SharedMemory::SharedMemory()
memory_(NULL),
read_only_(false),
mapped_size_(0),
- requested_size_(0),
- lock_(NULL) {
+ requested_size_(0) {
}
SharedMemory::SharedMemory(const std::wstring& name)
@@ -42,7 +41,6 @@ SharedMemory::SharedMemory(const std::wstring& name)
read_only_(false),
requested_size_(0),
mapped_size_(0),
- lock_(NULL),
name_(name) {
}
@@ -51,18 +49,17 @@ SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only)
memory_(NULL),
read_only_(read_only),
requested_size_(0),
- mapped_size_(0),
- lock_(NULL) {
+ mapped_size_(0) {
}
-SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only,
+SharedMemory::SharedMemory(SharedMemoryHandle handle,
+ bool read_only,
ProcessHandle process)
: mapped_file_(NULL),
memory_(NULL),
read_only_(read_only),
requested_size_(0),
- mapped_size_(0),
- lock_(NULL) {
+ mapped_size_(0) {
::DuplicateHandle(process, handle,
GetCurrentProcess(), &mapped_file_,
read_only_ ? FILE_MAP_READ : FILE_MAP_READ |
@@ -73,8 +70,6 @@ SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only,
SharedMemory::~SharedMemory() {
Unmap();
Close();
- if (lock_ != NULL)
- CloseHandle(lock_);
}
// static
@@ -270,26 +265,6 @@ void SharedMemory::Close() {
}
}
-void SharedMemory::LockDeprecated() {
- if (lock_ == NULL) {
- std::wstring name = name_;
- name.append(L"lock");
- lock_ = CreateMutex(NULL, FALSE, name.c_str());
- if (lock_ == NULL) {
- DPLOG(ERROR) << "Could not create mutex.";
- NOTREACHED();
- return; // There is nothing good we can do here.
- }
- }
- DWORD result = WaitForSingleObject(lock_, INFINITE);
- DCHECK_EQ(result, WAIT_OBJECT_0);
-}
-
-void SharedMemory::UnlockDeprecated() {
- DCHECK(lock_ != NULL);
- ReleaseMutex(lock_);
-}
-
SharedMemoryHandle SharedMemory::handle() const {
return mapped_file_;
}
« no previous file with comments | « base/memory/shared_memory_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698