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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 1045433002: Migrate ChromeOS to base::MemoryPressureMonitor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove no-longer-relevant OWNERS change Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #include <commctrl.h> 96 #include <commctrl.h>
97 #include <shellapi.h> 97 #include <shellapi.h>
98 98
99 #include "content/browser/system_message_window_win.h" 99 #include "content/browser/system_message_window_win.h"
100 #include "content/common/sandbox_win.h" 100 #include "content/common/sandbox_win.h"
101 #include "net/base/winsock_init.h" 101 #include "net/base/winsock_init.h"
102 #include "ui/base/l10n/l10n_util_win.h" 102 #include "ui/base/l10n/l10n_util_win.h"
103 #endif 103 #endif
104 104
105 #if defined(OS_CHROMEOS) 105 #if defined(OS_CHROMEOS)
106 #include "base/chromeos/memory_pressure_observer_chromeos.h" 106 #include "base/chromeos/memory_pressure_monitor_chromeos.h"
107 #include "chromeos/chromeos_switches.h" 107 #include "chromeos/chromeos_switches.h"
108 #endif 108 #endif
109 109
110 #if defined(USE_GLIB) 110 #if defined(USE_GLIB)
111 #include <glib-object.h> 111 #include <glib-object.h>
112 #endif 112 #endif
113 113
114 #if defined(OS_LINUX) && defined(USE_UDEV) 114 #if defined(OS_LINUX) && defined(USE_UDEV)
115 #include "content/browser/device_monitor_udev.h" 115 #include "content/browser/device_monitor_udev.h"
116 #elif defined(OS_MACOSX) && !defined(OS_IOS) 116 #elif defined(OS_MACOSX) && !defined(OS_IOS)
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 } 582 }
583 583
584 int BrowserMainLoop::PreCreateThreads() { 584 int BrowserMainLoop::PreCreateThreads() {
585 if (parts_) { 585 if (parts_) {
586 TRACE_EVENT0("startup", 586 TRACE_EVENT0("startup",
587 "BrowserMainLoop::CreateThreads:PreCreateThreads"); 587 "BrowserMainLoop::CreateThreads:PreCreateThreads");
588 result_code_ = parts_->PreCreateThreads(); 588 result_code_ = parts_->PreCreateThreads();
589 } 589 }
590 590
591 #if defined(OS_CHROMEOS) 591 #if defined(OS_CHROMEOS)
592 if (chromeos::switches::MemoryPressureHandlingEnabled()) { 592 if (chromeos::switches::MemoryPressureHandlingEnabled()) {
chrisha 2015/04/08 21:38:16 Hmm... might need to promote this to a pan-OS swit
dmichael (off chromium) 2015/04/08 22:09:03 Perhaps. It's just "always on" for Android I think
593 memory_pressure_observer_.reset(new base::MemoryPressureObserverChromeOS( 593 memory_pressure_observer_.reset(new base::MemoryPressureMonitorChromeOS(
594 chromeos::switches::GetMemoryPressureThresholds())); 594 chromeos::switches::GetMemoryPressureThresholds()));
595 } 595 }
596 #endif 596 #endif
597 597
598 #if defined(ENABLE_PLUGINS) 598 #if defined(ENABLE_PLUGINS)
599 // Prior to any processing happening on the io thread, we create the 599 // Prior to any processing happening on the io thread, we create the
600 // plugin service as it is predominantly used from the io thread, 600 // plugin service as it is predominantly used from the io thread,
601 // but must be created on the main thread. The service ctor is 601 // but must be created on the main thread. The service ctor is
602 // inexpensive and does not invoke the io_thread() accessor. 602 // inexpensive and does not invoke the io_thread() accessor.
603 { 603 {
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 1277
1278 void BrowserMainLoop::EndStartupTracing() { 1278 void BrowserMainLoop::EndStartupTracing() {
1279 is_tracing_startup_ = false; 1279 is_tracing_startup_ = false;
1280 TracingController::GetInstance()->DisableRecording( 1280 TracingController::GetInstance()->DisableRecording(
1281 TracingController::CreateFileSink( 1281 TracingController::CreateFileSink(
1282 startup_trace_file_, 1282 startup_trace_file_,
1283 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); 1283 base::Bind(OnStoppedStartupTracing, startup_trace_file_)));
1284 } 1284 }
1285 1285
1286 } // namespace content 1286 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698