Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index ff598a07ed9cfcfc6c38b2bbf9978cb950ae2f8a..e652d229f3a8dafb4e6b58e018370886ba4de931 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -15,7 +15,6 @@ |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/memory/discardable_memory.h" |
-#include "base/memory/discardable_memory_emulated.h" |
#include "base/memory/shared_memory.h" |
#include "base/metrics/field_trial.h" |
#include "base/metrics/histogram.h" |
@@ -179,9 +178,6 @@ |
// allocation that exceeds this limit. |
const size_t kImageCacheSingleAllocationByteLimit = 64 * 1024 * 1024; |
-const size_t kEmulatedDiscardableMemoryBytesToKeepWhenWidgetsHidden = |
- 4 * 1024 * 1024; |
- |
// Keep the global RenderThreadImpl in a TLS slot so it is impossible to access |
// incorrectly from the wrong thread. |
base::LazyInstance<base::ThreadLocalPointer<RenderThreadImpl> > |
@@ -537,6 +533,10 @@ |
} |
base::DiscardableMemory::SetPreferredType(type); |
+ |
+ // Allow discardable memory implementations to register memory pressure |
+ // listeners. |
+ base::DiscardableMemory::RegisterMemoryPressureListeners(); |
// AllocateGpuMemoryBuffer must be used exclusively on one thread but |
// it doesn't have to be the same thread RenderThreadImpl is created on. |
@@ -1609,12 +1609,6 @@ |
hidden_widget_count_++; |
if (widget_count_ && hidden_widget_count_ == widget_count_) { |
- // TODO(reveman): Remove this when we have a better mechanism to prevent |
- // total discardable memory used by all renderers from growing too large. |
- base::internal::DiscardableMemoryEmulated:: |
- ReduceMemoryUsageUntilWithinLimit( |
- kEmulatedDiscardableMemoryBytesToKeepWhenWidgetsHidden); |
- |
if (GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) |
ScheduleIdleHandler(kInitialIdleHandlerDelayMs); |
} |