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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2297273004: Revert "Revert of content: Fix Context creation logic in ContextProviderFactoryImpl. (patchset #10 … (Closed)
Patch Set: remove gpu process initialization failure Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index bc64398dc3657889fda88908cc44b7f2c8fa3e5e..b9cdb4fd1d90d7e623ee3776461da8684b104798 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -976,7 +976,6 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
#if defined(OS_ANDROID)
g_browser_main_loop_shutting_down = true;
- ui::ContextProviderFactory::SetInstance(nullptr);
#endif
if (RenderProcessHost::run_renderer_in_process())
@@ -1131,8 +1130,14 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
// it.
{
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GPUChannelFactory");
- if (BrowserGpuChannelHostFactory::instance())
+ if (BrowserGpuChannelHostFactory::instance()) {
+#if defined(OS_ANDROID)
+ // Clean up the references to the factory before terminating it.
+ ui::ContextProviderFactory::SetInstance(nullptr);
+ ContextProviderFactoryImpl::Terminate();
+#endif
BrowserGpuChannelHostFactory::Terminate();
+ }
}
// Must happen after the I/O thread is shutdown since this class lives on the
@@ -1213,6 +1218,8 @@ int BrowserMainLoop::BrowserThreadsStarted() {
established_gpu_channel = false;
always_uses_gpu = ShouldStartGpuProcessOnBrowserStartup();
BrowserGpuChannelHostFactory::Initialize(established_gpu_channel);
+ ContextProviderFactoryImpl::Initialize(
+ BrowserGpuChannelHostFactory::instance());
ui::ContextProviderFactory::SetInstance(
ContextProviderFactoryImpl::GetInstance());
#elif defined(USE_AURA) || defined(OS_MACOSX)
« no previous file with comments | « no previous file | content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698