| 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();
|
|
|