| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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()) { |
| 593 memory_pressure_observer_.reset(new base::MemoryPressureObserverChromeOS( | 593 memory_pressure_monitor_.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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 GpuProcessHostUIShim::DestroyAll(); | 845 GpuProcessHostUIShim::DestroyAll(); |
| 846 } | 846 } |
| 847 // Cancel pending requests and prevent new requests. | 847 // Cancel pending requests and prevent new requests. |
| 848 if (resource_dispatcher_host_) { | 848 if (resource_dispatcher_host_) { |
| 849 TRACE_EVENT0("shutdown", | 849 TRACE_EVENT0("shutdown", |
| 850 "BrowserMainLoop::Subsystem:ResourceDispatcherHost"); | 850 "BrowserMainLoop::Subsystem:ResourceDispatcherHost"); |
| 851 resource_dispatcher_host_.get()->Shutdown(); | 851 resource_dispatcher_host_.get()->Shutdown(); |
| 852 } | 852 } |
| 853 | 853 |
| 854 #if defined(OS_CHROMEOS) | 854 #if defined(OS_CHROMEOS) |
| 855 memory_pressure_observer_.reset(); | 855 memory_pressure_monitor_.reset(); |
| 856 #endif | 856 #endif |
| 857 | 857 |
| 858 #if defined(OS_MACOSX) | 858 #if defined(OS_MACOSX) |
| 859 BrowserCompositorMac::DisableRecyclingForShutdown(); | 859 BrowserCompositorMac::DisableRecyclingForShutdown(); |
| 860 #endif | 860 #endif |
| 861 | 861 |
| 862 #if defined(USE_AURA) || defined(OS_MACOSX) | 862 #if defined(USE_AURA) || defined(OS_MACOSX) |
| 863 { | 863 { |
| 864 TRACE_EVENT0("shutdown", | 864 TRACE_EVENT0("shutdown", |
| 865 "BrowserMainLoop::Subsystem:ImageTransportFactory"); | 865 "BrowserMainLoop::Subsystem:ImageTransportFactory"); |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |