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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 458343003: Revert of base: Introduce an explicit call for reducing emulated discardable memory usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/discardable_memory_win.cc ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « base/memory/discardable_memory_win.cc ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698