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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 #include "ui/aura/env.h" | 103 #include "ui/aura/env.h" |
| 104 #endif | 104 #endif |
| 105 | 105 |
| 106 #if defined(OS_ANDROID) | 106 #if defined(OS_ANDROID) |
| 107 #include "base/android/jni_android.h" | 107 #include "base/android/jni_android.h" |
| 108 #include "components/tracing/common/graphics_memory_dump_provider_android.h" | 108 #include "components/tracing/common/graphics_memory_dump_provider_android.h" |
| 109 #include "content/browser/android/browser_startup_controller.h" | 109 #include "content/browser/android/browser_startup_controller.h" |
| 110 #include "content/browser/android/browser_surface_texture_manager.h" | 110 #include "content/browser/android/browser_surface_texture_manager.h" |
| 111 #include "content/browser/android/tracing_controller_android.h" | 111 #include "content/browser/android/tracing_controller_android.h" |
| 112 #include "content/browser/media/android/browser_media_player_manager.h" | 112 #include "content/browser/media/android/browser_media_player_manager.h" |
| 113 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" | |
| 113 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" | 114 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" |
| 114 #include "content/public/browser/screen_orientation_provider.h" | 115 #include "content/public/browser/screen_orientation_provider.h" |
| 115 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" | 116 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" |
| 116 #include "media/base/android/media_client_android.h" | 117 #include "media/base/android/media_client_android.h" |
| 117 #include "ui/gl/gl_surface.h" | 118 #include "ui/gl/gl_surface.h" |
| 118 #endif | 119 #endif |
| 119 | 120 |
| 120 #if defined(OS_MACOSX) | 121 #if defined(OS_MACOSX) |
| 121 #include "base/memory/memory_pressure_monitor_mac.h" | 122 #include "base/memory/memory_pressure_monitor_mac.h" |
| 122 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 123 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1226 } | 1227 } |
| 1227 #endif | 1228 #endif |
| 1228 | 1229 |
| 1229 bool always_uses_gpu = true; | 1230 bool always_uses_gpu = true; |
| 1230 bool established_gpu_channel = false; | 1231 bool established_gpu_channel = false; |
| 1231 #if defined(OS_ANDROID) | 1232 #if defined(OS_ANDROID) |
| 1232 // TODO(crbug.com/439322): This should be set to |true|. | 1233 // TODO(crbug.com/439322): This should be set to |true|. |
| 1233 established_gpu_channel = false; | 1234 established_gpu_channel = false; |
| 1234 always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup(); | 1235 always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup(); |
| 1235 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 1236 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
| 1237 ui::ContextProviderFactory::SetInstance( | |
| 1238 ContextProviderFactoryImpl::GetInstance()); | |
|
no sievers
2016/08/02 20:44:33
still leaking. (i'm not worried about a normal app
Khushal
2016/08/02 22:22:15
Resetting it on shutdown. Is that better?
| |
| 1236 #elif defined(USE_AURA) || defined(OS_MACOSX) | 1239 #elif defined(USE_AURA) || defined(OS_MACOSX) |
| 1237 established_gpu_channel = true; | 1240 established_gpu_channel = true; |
| 1238 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || | 1241 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || |
| 1239 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) || | 1242 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) || |
| 1240 shell::ShellIsRemote()) { | 1243 shell::ShellIsRemote()) { |
| 1241 established_gpu_channel = always_uses_gpu = false; | 1244 established_gpu_channel = always_uses_gpu = false; |
| 1242 } | 1245 } |
| 1243 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); | 1246 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); |
| 1244 ImageTransportFactory::Initialize(); | 1247 ImageTransportFactory::Initialize(); |
| 1245 #if defined(USE_AURA) | 1248 #if defined(USE_AURA) |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1517 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1520 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
| 1518 audio_thread_->task_runner(); | 1521 audio_thread_->task_runner(); |
| 1519 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1522 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
| 1520 std::move(worker_task_runner), | 1523 std::move(worker_task_runner), |
| 1521 MediaInternals::GetInstance()); | 1524 MediaInternals::GetInstance()); |
| 1522 } | 1525 } |
| 1523 CHECK(audio_manager_); | 1526 CHECK(audio_manager_); |
| 1524 } | 1527 } |
| 1525 | 1528 |
| 1526 } // namespace content | 1529 } // namespace content |
| OLD | NEW |