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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 #include "content/browser/cocoa/system_hotkey_helper_mac.h" | 94 #include "content/browser/cocoa/system_hotkey_helper_mac.h" |
95 #include "content/browser/compositor/browser_compositor_view_mac.h" | 95 #include "content/browser/compositor/browser_compositor_view_mac.h" |
96 #include "content/browser/theme_helper_mac.h" | 96 #include "content/browser/theme_helper_mac.h" |
97 #endif | 97 #endif |
98 | 98 |
99 #if defined(OS_WIN) | 99 #if defined(OS_WIN) |
100 #include <windows.h> | 100 #include <windows.h> |
101 #include <commctrl.h> | 101 #include <commctrl.h> |
102 #include <shellapi.h> | 102 #include <shellapi.h> |
103 | 103 |
| 104 #include "base/win/memory_pressure_monitor.h" |
104 #include "content/browser/system_message_window_win.h" | 105 #include "content/browser/system_message_window_win.h" |
105 #include "content/common/sandbox_win.h" | 106 #include "content/common/sandbox_win.h" |
106 #include "net/base/winsock_init.h" | 107 #include "net/base/winsock_init.h" |
107 #include "ui/base/l10n/l10n_util_win.h" | 108 #include "ui/base/l10n/l10n_util_win.h" |
108 #endif | 109 #endif |
109 | 110 |
110 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
111 #include "base/chromeos/memory_pressure_monitor_chromeos.h" | 112 #include "base/chromeos/memory_pressure_monitor_chromeos.h" |
112 #include "chromeos/chromeos_switches.h" | 113 #include "chromeos/chromeos_switches.h" |
113 #endif | 114 #endif |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 result_code_ = parts_->PreCreateThreads(); | 607 result_code_ = parts_->PreCreateThreads(); |
607 } | 608 } |
608 | 609 |
609 #if defined(OS_CHROMEOS) | 610 #if defined(OS_CHROMEOS) |
610 if (chromeos::switches::MemoryPressureHandlingEnabled()) { | 611 if (chromeos::switches::MemoryPressureHandlingEnabled()) { |
611 memory_pressure_monitor_.reset(new base::MemoryPressureMonitorChromeOS( | 612 memory_pressure_monitor_.reset(new base::MemoryPressureMonitorChromeOS( |
612 chromeos::switches::GetMemoryPressureThresholds())); | 613 chromeos::switches::GetMemoryPressureThresholds())); |
613 } | 614 } |
614 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 615 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
615 memory_pressure_monitor_.reset(new base::MemoryPressureMonitorMac()); | 616 memory_pressure_monitor_.reset(new base::MemoryPressureMonitorMac()); |
| 617 #elif defined(OS_WIN) |
| 618 memory_pressure_monitor_.reset(new base::win::MemoryPressureMonitor()); |
616 #endif | 619 #endif |
617 | 620 |
618 #if defined(ENABLE_PLUGINS) | 621 #if defined(ENABLE_PLUGINS) |
619 // Prior to any processing happening on the io thread, we create the | 622 // Prior to any processing happening on the io thread, we create the |
620 // plugin service as it is predominantly used from the io thread, | 623 // plugin service as it is predominantly used from the io thread, |
621 // but must be created on the main thread. The service ctor is | 624 // but must be created on the main thread. The service ctor is |
622 // inexpensive and does not invoke the io_thread() accessor. | 625 // inexpensive and does not invoke the io_thread() accessor. |
623 { | 626 { |
624 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); | 627 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); |
625 PluginService::GetInstance()->Init(); | 628 PluginService::GetInstance()->Init(); |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 | 1313 |
1311 void BrowserMainLoop::EndStartupTracing() { | 1314 void BrowserMainLoop::EndStartupTracing() { |
1312 is_tracing_startup_ = false; | 1315 is_tracing_startup_ = false; |
1313 TracingController::GetInstance()->DisableRecording( | 1316 TracingController::GetInstance()->DisableRecording( |
1314 TracingController::CreateFileSink( | 1317 TracingController::CreateFileSink( |
1315 startup_trace_file_, | 1318 startup_trace_file_, |
1316 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1319 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1317 } | 1320 } |
1318 | 1321 |
1319 } // namespace content | 1322 } // namespace content |
OLD | NEW |