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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 10239012: Route calls to tcmalloc MallocExtension through allocator agnostic interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « content/common/child_thread.cc ('k') | no next file » | 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 dc7a040226fe11fed71fa73a05b993e73a2b3f97..18b73eb421090723684846d0df2bf7750b92ecf8 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -9,6 +9,7 @@
#include <map>
#include <vector>
+#include "base/allocator/allocator_extension.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/lazy_instance.h"
@@ -64,7 +65,6 @@
#include "media/base/media.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
-#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
@@ -638,9 +638,8 @@ void RenderThreadImpl::IdleHandler() {
IdleHandlerInForegroundTab();
return;
}
-#if !defined(OS_MACOSX) && defined(USE_TCMALLOC)
- MallocExtension::instance()->ReleaseFreeMemory();
-#endif
+
+ base::allocator::ReleaseFreeMemory();
v8::V8::IdleNotification();
@@ -678,9 +677,7 @@ void RenderThreadImpl::IdleHandlerInForegroundTab() {
// idle pause. We set it proportional to the idle timer delay.
int idle_hint = static_cast<int>(new_delay_ms / 10);
if (cpu_usage < kIdleCPUUsageThresholdInPercents) {
-#if !defined(OS_MACOSX) && defined(USE_TCMALLOC)
- MallocExtension::instance()->ReleaseFreeMemory();
-#endif
+ base::allocator::ReleaseFreeMemory();
if (v8::V8::IdleNotification(idle_hint)) {
// V8 finished collecting garbage.
new_delay_ms = kLongIdleHandlerDelayMs;
« no previous file with comments | « content/common/child_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698