| 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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 #if defined(OS_CHROMEOS) | 122 #if defined(OS_CHROMEOS) |
| 123 #include "base/memory/memory_pressure_monitor_chromeos.h" | 123 #include "base/memory/memory_pressure_monitor_chromeos.h" |
| 124 #include "chromeos/chromeos_switches.h" | 124 #include "chromeos/chromeos_switches.h" |
| 125 #endif | 125 #endif |
| 126 | 126 |
| 127 #if defined(USE_GLIB) | 127 #if defined(USE_GLIB) |
| 128 #include <glib-object.h> | 128 #include <glib-object.h> |
| 129 #endif | 129 #endif |
| 130 | 130 |
| 131 #if defined(OS_LINUX) |
| 132 #include "base/memory/memory_pressure_monitor_linux.h" |
| 133 #endif |
| 134 |
| 131 #if defined(OS_LINUX) && defined(USE_UDEV) | 135 #if defined(OS_LINUX) && defined(USE_UDEV) |
| 132 #include "content/browser/device_monitor_udev.h" | 136 #include "content/browser/device_monitor_udev.h" |
| 133 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 137 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 134 #include "content/browser/device_monitor_mac.h" | 138 #include "content/browser/device_monitor_mac.h" |
| 135 #endif | 139 #endif |
| 136 | 140 |
| 137 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 141 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 138 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 142 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| 139 #include "content/browser/zygote_host/zygote_host_impl_linux.h" | 143 #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
| 140 #include "sandbox/linux/suid/client/setuid_sandbox_host.h" | 144 #include "sandbox/linux/suid/client/setuid_sandbox_host.h" |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 result_code_ = parts_->PreCreateThreads(); | 661 result_code_ = parts_->PreCreateThreads(); |
| 658 } | 662 } |
| 659 | 663 |
| 660 // TODO(chrisha): Abstract away this construction mess to a helper function, | 664 // TODO(chrisha): Abstract away this construction mess to a helper function, |
| 661 // once MemoryPressureMonitor is made a concrete class. | 665 // once MemoryPressureMonitor is made a concrete class. |
| 662 #if defined(OS_CHROMEOS) | 666 #if defined(OS_CHROMEOS) |
| 663 if (chromeos::switches::MemoryPressureHandlingEnabled()) { | 667 if (chromeos::switches::MemoryPressureHandlingEnabled()) { |
| 664 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( | 668 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( |
| 665 chromeos::switches::GetMemoryPressureThresholds())); | 669 chromeos::switches::GetMemoryPressureThresholds())); |
| 666 } | 670 } |
| 671 #elif defined(OS_LINUX) |
| 672 memory_pressure_monitor_.reset(new base::nix::MemoryPressureMonitor()); |
| 667 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 673 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
| 668 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); | 674 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); |
| 669 #elif defined(OS_WIN) | 675 #elif defined(OS_WIN) |
| 670 memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor( | 676 memory_pressure_monitor_.reset(CreateWinMemoryPressureMonitor( |
| 671 parsed_command_line_)); | 677 parsed_command_line_)); |
| 672 #endif | 678 #endif |
| 673 | 679 |
| 674 #if defined(ENABLE_PLUGINS) | 680 #if defined(ENABLE_PLUGINS) |
| 675 // Prior to any processing happening on the io thread, we create the | 681 // Prior to any processing happening on the io thread, we create the |
| 676 // plugin service as it is predominantly used from the io thread, | 682 // plugin service as it is predominantly used from the io thread, |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1345 DCHECK(is_tracing_startup_); | 1351 DCHECK(is_tracing_startup_); |
| 1346 | 1352 |
| 1347 is_tracing_startup_ = false; | 1353 is_tracing_startup_ = false; |
| 1348 TracingController::GetInstance()->DisableRecording( | 1354 TracingController::GetInstance()->DisableRecording( |
| 1349 TracingController::CreateFileSink( | 1355 TracingController::CreateFileSink( |
| 1350 startup_trace_file_, | 1356 startup_trace_file_, |
| 1351 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1357 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1352 } | 1358 } |
| 1353 | 1359 |
| 1354 } // namespace content | 1360 } // namespace content |
| OLD | NEW |