Chromium Code Reviews| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 #include "ui/aura/env.h" | 104 #include "ui/aura/env.h" |
| 105 #endif | 105 #endif |
| 106 | 106 |
| 107 #if defined(OS_ANDROID) | 107 #if defined(OS_ANDROID) |
| 108 #include "base/android/jni_android.h" | 108 #include "base/android/jni_android.h" |
| 109 #include "components/tracing/common/graphics_memory_dump_provider_android.h" | 109 #include "components/tracing/common/graphics_memory_dump_provider_android.h" |
| 110 #include "content/browser/android/browser_startup_controller.h" | 110 #include "content/browser/android/browser_startup_controller.h" |
| 111 #include "content/browser/android/browser_surface_texture_manager.h" | 111 #include "content/browser/android/browser_surface_texture_manager.h" |
| 112 #include "content/browser/android/tracing_controller_android.h" | 112 #include "content/browser/android/tracing_controller_android.h" |
| 113 #include "content/browser/media/android/browser_media_player_manager.h" | 113 #include "content/browser/media/android/browser_media_player_manager.h" |
| 114 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" | |
| 114 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" | 115 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" |
| 115 #include "content/public/browser/screen_orientation_provider.h" | 116 #include "content/public/browser/screen_orientation_provider.h" |
| 116 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" | 117 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" |
| 117 #include "media/base/android/media_client_android.h" | 118 #include "media/base/android/media_client_android.h" |
| 119 #include "ui/android/context_provider_factory.h" | |
|
no sievers
2016/07/29 19:14:30
nit: not needed for base class
| |
| 118 #include "ui/gl/gl_surface.h" | 120 #include "ui/gl/gl_surface.h" |
| 119 #endif | 121 #endif |
| 120 | 122 |
| 121 #if defined(OS_MACOSX) | 123 #if defined(OS_MACOSX) |
| 122 #include "base/memory/memory_pressure_monitor_mac.h" | 124 #include "base/memory/memory_pressure_monitor_mac.h" |
| 123 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 125 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
| 124 #include "content/browser/cocoa/system_hotkey_helper_mac.h" | 126 #include "content/browser/cocoa/system_hotkey_helper_mac.h" |
| 125 #include "content/browser/mach_broker_mac.h" | 127 #include "content/browser/mach_broker_mac.h" |
| 126 #include "content/browser/renderer_host/browser_compositor_view_mac.h" | 128 #include "content/browser/renderer_host/browser_compositor_view_mac.h" |
| 127 #include "content/browser/theme_helper_mac.h" | 129 #include "content/browser/theme_helper_mac.h" |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1227 } | 1229 } |
| 1228 #endif | 1230 #endif |
| 1229 | 1231 |
| 1230 bool always_uses_gpu = true; | 1232 bool always_uses_gpu = true; |
| 1231 bool established_gpu_channel = false; | 1233 bool established_gpu_channel = false; |
| 1232 #if defined(OS_ANDROID) | 1234 #if defined(OS_ANDROID) |
| 1233 // TODO(crbug.com/439322): This should be set to |true|. | 1235 // TODO(crbug.com/439322): This should be set to |true|. |
| 1234 established_gpu_channel = false; | 1236 established_gpu_channel = false; |
| 1235 always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup(); | 1237 always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup(); |
| 1236 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 1238 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
| 1239 ui::ContextProviderFactory::SetInstance( | |
| 1240 ContextProviderFactoryImpl::GetInstance()); | |
|
no sievers
2016/07/29 19:14:30
do we leak this?
Can you unset it somewhere aroun
Khushal
2016/07/29 21:30:55
The singleton would still remain with the ContextP
no sievers
2016/07/29 21:42:41
sounds good
| |
| 1237 #elif defined(USE_AURA) || defined(OS_MACOSX) | 1241 #elif defined(USE_AURA) || defined(OS_MACOSX) |
| 1238 established_gpu_channel = true; | 1242 established_gpu_channel = true; |
| 1239 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || | 1243 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || |
| 1240 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) || | 1244 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) || |
| 1241 shell::ShellIsRemote()) { | 1245 shell::ShellIsRemote()) { |
| 1242 established_gpu_channel = always_uses_gpu = false; | 1246 established_gpu_channel = always_uses_gpu = false; |
| 1243 } | 1247 } |
| 1244 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 1248 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
| 1245 ImageTransportFactory::Initialize(); | 1249 ImageTransportFactory::Initialize(); |
| 1246 #if defined(USE_AURA) | 1250 #if defined(USE_AURA) |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1518 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1522 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
| 1519 audio_thread_->task_runner(); | 1523 audio_thread_->task_runner(); |
| 1520 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1524 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
| 1521 std::move(worker_task_runner), | 1525 std::move(worker_task_runner), |
| 1522 MediaInternals::GetInstance()); | 1526 MediaInternals::GetInstance()); |
| 1523 } | 1527 } |
| 1524 CHECK(audio_manager_); | 1528 CHECK(audio_manager_); |
| 1525 } | 1529 } |
| 1526 | 1530 |
| 1527 } // namespace content | 1531 } // namespace content |
| OLD | NEW |