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