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