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

Unified Diff: content/browser/browser_main_loop.cc

Issue 1654863003: Kill --memory-metrics and on-demand Memory.Browser/RenderUsed histograms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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/browser/browser_main_loop.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 22c3e582f82b06dc0d1d2f72e5baf507e15ce85e..751bb30d5beffc521106c2a3658e2169ab109bdb 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -378,27 +378,6 @@ base::win::MemoryPressureMonitor* CreateWinMemoryPressureMonitor(
// The currently-running BrowserMainLoop. There can be one or zero.
BrowserMainLoop* g_current_browser_main_loop = NULL;
-// For measuring memory usage after each task. Behind a command line flag.
-class BrowserMainLoop::MemoryObserver : public base::MessageLoop::TaskObserver {
- public:
- MemoryObserver() {}
- ~MemoryObserver() override {}
-
- void WillProcessTask(const base::PendingTask& pending_task) override {}
-
- void DidProcessTask(const base::PendingTask& pending_task) override {
-#if !defined(OS_IOS) // No ProcessMetrics on IOS.
- scoped_ptr<base::ProcessMetrics> process_metrics(
- base::ProcessMetrics::CreateCurrentProcessMetrics());
- size_t private_bytes;
- process_metrics->GetMemoryBytes(&private_bytes, NULL);
- LOCAL_HISTOGRAM_MEMORY_KB("Memory.BrowserUsed", private_bytes >> 10);
-#endif
- }
- private:
- DISALLOW_COPY_AND_ASSIGN(MemoryObserver);
-};
-
// BrowserMainLoop construction / destruction =============================
@@ -675,12 +654,6 @@ void BrowserMainLoop::PostMainMessageLoopStart() {
ui::OzonePlatform::GetInstance()->OpenClientNativePixmapDevice());
#endif
- if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) {
- TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver");
- memory_observer_.reset(new MemoryObserver());
- base::MessageLoop::current()->AddTaskObserver(memory_observer_.get());
- }
-
if (parsed_command_line_.HasSwitch(
switches::kEnableAggressiveDOMStorageFlushing)) {
TRACE_EVENT0("startup",
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698