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

Unified Diff: content/browser/browser_main_loop.cc

Issue 800603002: Move MemoryPressureObserverChromeOS instantiation from Chrome to Content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving again Created 6 years 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
« content/browser/browser_main_loop.h ('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 5c52dad86698c5861fe31eebd078af9ffcde6c96..d7758b74a9721e7a7b9868f026a59355b576eadc 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -100,6 +100,11 @@
#include "ui/base/l10n/l10n_util_win.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "base/chromeos/memory_pressure_observer_chromeos.h"
+#include "chromeos/chromeos_switches.h"
+#endif
+
#if defined(USE_GLIB)
#include <glib-object.h>
#endif
@@ -475,7 +480,12 @@ void BrowserMainLoop::MainMessageLoopStart() {
l10n_util::OverrideLocaleWithUILanguageList();
}
#endif
-
+#if defined(OS_CHROMEOS)
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kUseMemoryPressureSystemChromeOS)) {
+ memory_pressure_observer_.reset(new base::MemoryPressureObserverChromeOS);
+ }
+#endif
// Create a MessageLoop if one does not already exist for the current thread.
if (!base::MessageLoop::current())
main_message_loop_.reset(new base::MessageLoopForUI);
@@ -823,6 +833,10 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
resource_dispatcher_host_.get()->Shutdown();
}
+#if defined(OS_CHROMEOS)
+ memory_pressure_observer_.reset();
+#endif
+
#if defined(OS_MACOSX)
BrowserCompositorMac::DisableRecyclingForShutdown();
#endif
« content/browser/browser_main_loop.h ('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