Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2190033002: content: Add ContextProviderFactory to create a render ContextProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove display_ DCHECK. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/compositor/surface_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 // Teardown may start in PostMainMessageLoopRun, and during teardown we 976 // Teardown may start in PostMainMessageLoopRun, and during teardown we
976 // need to be able to perform IO. 977 // need to be able to perform IO.
977 base::ThreadRestrictions::SetIOAllowed(true); 978 base::ThreadRestrictions::SetIOAllowed(true);
978 BrowserThread::PostTask( 979 BrowserThread::PostTask(
979 BrowserThread::IO, FROM_HERE, 980 BrowserThread::IO, FROM_HERE,
980 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed), 981 base::Bind(base::IgnoreResult(&base::ThreadRestrictions::SetIOAllowed),
981 true)); 982 true));
982 983
983 #if defined(OS_ANDROID) 984 #if defined(OS_ANDROID)
984 g_browser_main_loop_shutting_down = true; 985 g_browser_main_loop_shutting_down = true;
986 ui::ContextProviderFactory::SetInstance(nullptr);
985 #endif 987 #endif
986 988
987 if (RenderProcessHost::run_renderer_in_process()) 989 if (RenderProcessHost::run_renderer_in_process())
988 RenderProcessHostImpl::ShutDownInProcessRenderer(); 990 RenderProcessHostImpl::ShutDownInProcessRenderer();
989 991
990 if (parts_) { 992 if (parts_) {
991 TRACE_EVENT0("shutdown", 993 TRACE_EVENT0("shutdown",
992 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun"); 994 "BrowserMainLoop::Subsystem:PostMainMessageLoopRun");
993 parts_->PostMainMessageLoopRun(); 995 parts_->PostMainMessageLoopRun();
994 } 996 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 } 1228 }
1227 #endif 1229 #endif
1228 1230
1229 bool always_uses_gpu = true; 1231 bool always_uses_gpu = true;
1230 bool established_gpu_channel = false; 1232 bool established_gpu_channel = false;
1231 #if defined(OS_ANDROID) 1233 #if defined(OS_ANDROID)
1232 // TODO(crbug.com/439322): This should be set to |true|. 1234 // TODO(crbug.com/439322): This should be set to |true|.
1233 established_gpu_channel = false; 1235 established_gpu_channel = false;
1234 always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup(); 1236 always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup();
1235 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); 1237 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel);
1238 ui::ContextProviderFactory::SetInstance(
1239 ContextProviderFactoryImpl::GetInstance());
1236 #elif defined(USE_AURA) || defined(OS_MACOSX) 1240 #elif defined(USE_AURA) || defined(OS_MACOSX)
1237 established_gpu_channel = true; 1241 established_gpu_channel = true;
1238 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() || 1242 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor() ||
1239 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) || 1243 parsed_command_line_.HasSwitch(switches::kDisableGpuEarlyInit) ||
1240 shell::ShellIsRemote()) { 1244 shell::ShellIsRemote()) {
1241 established_gpu_channel = always_uses_gpu = false; 1245 established_gpu_channel = always_uses_gpu = false;
1242 } 1246 }
1243 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); 1247 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel);
1244 ImageTransportFactory::Initialize(); 1248 ImageTransportFactory::Initialize();
1245 #if defined(USE_AURA) 1249 #if defined(USE_AURA)
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = 1518 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner =
1515 audio_thread_->task_runner(); 1519 audio_thread_->task_runner();
1516 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), 1520 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner),
1517 std::move(worker_task_runner), 1521 std::move(worker_task_runner),
1518 MediaInternals::GetInstance()); 1522 MediaInternals::GetInstance());
1519 } 1523 }
1520 CHECK(audio_manager_); 1524 CHECK(audio_manager_);
1521 } 1525 }
1522 1526
1523 } // namespace content 1527 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/surface_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698