| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/base_switches.h" |
| 13 #include "base/bind.h" | 14 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 15 #include "base/feature_list.h" | 16 #include "base/feature_list.h" |
| 16 #include "base/location.h" | 17 #include "base/location.h" |
| 17 #include "base/logging.h" | 18 #include "base/logging.h" |
| 18 #include "base/macros.h" | 19 #include "base/macros.h" |
| 19 #include "base/memory/memory_coordinator_proxy.h" | 20 #include "base/memory/memory_coordinator_proxy.h" |
| 20 #include "base/memory/memory_pressure_monitor.h" | 21 #include "base/memory/memory_pressure_monitor.h" |
| 21 #include "base/memory/ptr_util.h" | 22 #include "base/memory/ptr_util.h" |
| 22 #include "base/metrics/field_trial.h" | 23 #include "base/metrics/field_trial.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 #include "content/browser/android/tracing_controller_android.h" | 129 #include "content/browser/android/tracing_controller_android.h" |
| 129 #include "content/browser/media/android/browser_media_player_manager.h" | 130 #include "content/browser/media/android/browser_media_player_manager.h" |
| 130 #include "content/browser/screen_orientation/screen_orientation_delegate_android
.h" | 131 #include "content/browser/screen_orientation/screen_orientation_delegate_android
.h" |
| 131 #include "media/base/android/media_drm_bridge_client.h" | 132 #include "media/base/android/media_drm_bridge_client.h" |
| 132 #include "ui/android/screen_android.h" | 133 #include "ui/android/screen_android.h" |
| 133 #include "ui/display/screen.h" | 134 #include "ui/display/screen.h" |
| 134 #include "ui/gl/gl_surface.h" | 135 #include "ui/gl/gl_surface.h" |
| 135 #endif | 136 #endif |
| 136 | 137 |
| 137 #if defined(OS_MACOSX) | 138 #if defined(OS_MACOSX) |
| 139 #include "base/allocator/allocator_interception_mac.h" |
| 138 #include "base/memory/memory_pressure_monitor_mac.h" | 140 #include "base/memory/memory_pressure_monitor_mac.h" |
| 139 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 141 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
| 140 #include "content/browser/cocoa/system_hotkey_helper_mac.h" | 142 #include "content/browser/cocoa/system_hotkey_helper_mac.h" |
| 141 #include "content/browser/mach_broker_mac.h" | 143 #include "content/browser/mach_broker_mac.h" |
| 142 #include "content/browser/renderer_host/browser_compositor_view_mac.h" | 144 #include "content/browser/renderer_host/browser_compositor_view_mac.h" |
| 143 #include "content/browser/theme_helper_mac.h" | 145 #include "content/browser/theme_helper_mac.h" |
| 144 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" | 146 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" |
| 145 #endif | 147 #endif |
| 146 | 148 |
| 147 #if defined(USE_OZONE) | 149 #if defined(USE_OZONE) |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 // the second time. | 855 // the second time. |
| 854 base::FeatureList::InitializeInstance( | 856 base::FeatureList::InitializeInstance( |
| 855 command_line->GetSwitchValueASCII(switches::kEnableFeatures), | 857 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
| 856 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); | 858 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
| 857 | 859 |
| 858 InitializeMemoryManagementComponent(); | 860 InitializeMemoryManagementComponent(); |
| 859 | 861 |
| 860 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) | 862 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) |
| 861 MemoryCoordinatorImpl::GetInstance()->Start(); | 863 MemoryCoordinatorImpl::GetInstance()->Start(); |
| 862 | 864 |
| 865 #if defined(OS_MACOSX) |
| 866 if (base::CommandLine::InitializedForCurrentProcess() && |
| 867 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 868 switches::kEnableHeapProfiling)) { |
| 869 base::allocator::PeriodicallyShimNewMallocZones(); |
| 870 } |
| 871 #endif |
| 872 |
| 863 #if BUILDFLAG(ENABLE_PLUGINS) | 873 #if BUILDFLAG(ENABLE_PLUGINS) |
| 864 // Prior to any processing happening on the IO thread, we create the | 874 // Prior to any processing happening on the IO thread, we create the |
| 865 // plugin service as it is predominantly used from the IO thread, | 875 // plugin service as it is predominantly used from the IO thread, |
| 866 // but must be created on the main thread. The service ctor is | 876 // but must be created on the main thread. The service ctor is |
| 867 // inexpensive and does not invoke the io_thread() accessor. | 877 // inexpensive and does not invoke the io_thread() accessor. |
| 868 { | 878 { |
| 869 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); | 879 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); |
| 870 PluginService::GetInstance()->Init(); | 880 PluginService::GetInstance()->Init(); |
| 871 } | 881 } |
| 872 #endif | 882 #endif |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 1783 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 1774 MediaInternals::GetInstance()); | 1784 MediaInternals::GetInstance()); |
| 1775 } | 1785 } |
| 1776 CHECK(audio_manager_); | 1786 CHECK(audio_manager_); |
| 1777 | 1787 |
| 1778 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1788 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
| 1779 CHECK(audio_system_); | 1789 CHECK(audio_system_); |
| 1780 } | 1790 } |
| 1781 | 1791 |
| 1782 } // namespace content | 1792 } // namespace content |
| OLD | NEW |