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

Unified Diff: content/browser/browser_main_loop.cc

Issue 1124163003: Rename OS-specific MemoryPressureMonitor implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error on ChromeOS. Created 5 years, 7 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
« base/mac/memory_pressure_monitor.cc ('K') | « content/browser/browser_main_loop.h ('k') | no next file » | 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 a7178dbb2bc5061138458029550860e730499d01..4d6c6c369a14133cdd14aba34e541ed8bdf653dd 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/memory/memory_pressure_monitor.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
@@ -91,7 +92,7 @@
#endif
#if defined(OS_MACOSX) && !defined(OS_IOS)
-#include "base/mac/memory_pressure_monitor_mac.h"
+#include "base/mac/memory_pressure_monitor.h"
#include "content/browser/bootstrap_sandbox_mac.h"
#include "content/browser/cocoa/system_hotkey_helper_mac.h"
#include "content/browser/compositor/browser_compositor_view_mac.h"
@@ -111,7 +112,7 @@
#endif
#if defined(OS_CHROMEOS)
-#include "base/chromeos/memory_pressure_monitor_chromeos.h"
+#include "base/chromeos/memory_pressure_monitor.h"
#include "chromeos/chromeos_switches.h"
#endif
@@ -644,13 +645,15 @@ int BrowserMainLoop::PreCreateThreads() {
result_code_ = parts_->PreCreateThreads();
}
+ // TODO(chrisha): Abstract away this construction mess to a helper function,
+ // once MemoryPressureMonitor is made a concrete class.
#if defined(OS_CHROMEOS)
if (chromeos::switches::MemoryPressureHandlingEnabled()) {
- memory_pressure_monitor_.reset(new base::MemoryPressureMonitorChromeOS(
+ memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor(
chromeos::switches::GetMemoryPressureThresholds()));
}
#elif defined(OS_MACOSX) && !defined(OS_IOS)
- memory_pressure_monitor_.reset(new base::MemoryPressureMonitorMac());
+ memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor());
#elif defined(OS_WIN)
memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor(
parsed_command_line_));
@@ -917,9 +920,7 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
resource_dispatcher_host_.get()->Shutdown();
}
-#if defined(OS_CHROMEOS) || defined(OS_MACOSX)
memory_pressure_monitor_.reset();
-#endif
#if defined(OS_MACOSX)
BrowserCompositorMac::DisableRecyclingForShutdown();
« base/mac/memory_pressure_monitor.cc ('K') | « content/browser/browser_main_loop.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698