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

Unified Diff: base/memory/discardable_shared_memory.cc

Issue 1850703004: [Discardable Shared Memory] Remove Windows (un)pinning support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_shared_memory.cc
diff --git a/base/memory/discardable_shared_memory.cc b/base/memory/discardable_shared_memory.cc
index 7449f462e68ea4936b6c381239b316da59862594..05f56d3ffde365b36fc29869cd6a9351d39d1b3f 100644
--- a/base/memory/discardable_shared_memory.cc
+++ b/base/memory/discardable_shared_memory.cc
@@ -24,10 +24,6 @@
#include "third_party/ashmem/ashmem.h"
#endif
-#if defined(OS_WIN)
-#include "base/win/windows_version.h"
-#endif
-
namespace base {
namespace {
@@ -230,14 +226,6 @@ DiscardableSharedMemory::LockResult DiscardableSharedMemory::Lock(
return PURGED;
}
}
-#elif defined(OS_WIN)
- if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
- if (!VirtualAlloc(reinterpret_cast<char*>(shared_memory_.memory()) +
- AlignToPageSize(sizeof(SharedState)) + offset,
- length, MEM_RESET_UNDO, PAGE_READWRITE)) {
- return PURGED;
- }
- }
#endif
return SUCCESS;
@@ -265,18 +253,6 @@ void DiscardableSharedMemory::Unlock(size_t offset, size_t length) {
DPLOG(ERROR) << "ashmem_unpin_region() failed";
}
}
-#elif defined(OS_WIN)
- if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
- // Note: MEM_RESET is not technically gated on Win8. However, this Unlock
- // function needs to match the Lock behaviour (MEM_RESET_UNDO) to properly
- // implement memory pinning. It needs to bias towards preserving the
- // contents of memory between an Unlock and next Lock.
- if (!VirtualAlloc(reinterpret_cast<char*>(shared_memory_.memory()) +
- AlignToPageSize(sizeof(SharedState)) + offset,
- length, MEM_RESET, PAGE_READWRITE)) {
- DPLOG(ERROR) << "VirtualAlloc() MEM_RESET failed in Unlock()";
- }
- }
#endif
size_t start = offset / base::GetPageSize();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698