| OLD | NEW |
| 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 } | 481 } |
| 482 #endif | 482 #endif |
| 483 | 483 |
| 484 // Create a MessageLoop if one does not already exist for the current thread. | 484 // Create a MessageLoop if one does not already exist for the current thread. |
| 485 if (!base::MessageLoop::current()) | 485 if (!base::MessageLoop::current()) |
| 486 main_message_loop_.reset(new base::MessageLoopForUI); | 486 main_message_loop_.reset(new base::MessageLoopForUI); |
| 487 | 487 |
| 488 InitializeMainThread(); | 488 InitializeMainThread(); |
| 489 | 489 |
| 490 #if defined(OS_CHROMEOS) | 490 #if defined(OS_CHROMEOS) |
| 491 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 491 if (chromeos::switches::MemoryPressureHandlingEnabled()) { |
| 492 chromeos::switches::kDisableMemoryPressureSystemChromeOS)) { | |
| 493 memory_pressure_observer_.reset(new base::MemoryPressureObserverChromeOS( | 492 memory_pressure_observer_.reset(new base::MemoryPressureObserverChromeOS( |
| 494 chromeos::switches::GetMemoryPressureThresholds())); | 493 chromeos::switches::GetMemoryPressureThresholds())); |
| 495 } | 494 } |
| 496 #endif | 495 #endif |
| 497 | 496 |
| 498 { | 497 { |
| 499 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:SystemMonitor"); | 498 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:SystemMonitor"); |
| 500 system_monitor_.reset(new base::SystemMonitor); | 499 system_monitor_.reset(new base::SystemMonitor); |
| 501 } | 500 } |
| 502 { | 501 { |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1271 | 1270 |
| 1272 void BrowserMainLoop::EndStartupTracing() { | 1271 void BrowserMainLoop::EndStartupTracing() { |
| 1273 is_tracing_startup_ = false; | 1272 is_tracing_startup_ = false; |
| 1274 TracingController::GetInstance()->DisableRecording( | 1273 TracingController::GetInstance()->DisableRecording( |
| 1275 TracingController::CreateFileSink( | 1274 TracingController::CreateFileSink( |
| 1276 startup_trace_file_, | 1275 startup_trace_file_, |
| 1277 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1276 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1278 } | 1277 } |
| 1279 | 1278 |
| 1280 } // namespace content | 1279 } // namespace content |
| OLD | NEW |