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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2892093002: Initialize GpuDataManagerImpl after GpuDataManagerVisualProxy (Closed)
Patch Set: Add comment Created 3 years, 7 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 | no next file » | 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 559f00ff8e3812b91e88ca2140b6c9d8b461c159..d86a7a4b43a142e5f53e6f8faca76d011b487609 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -877,18 +877,21 @@ int BrowserMainLoop::PreCreateThreads() {
ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get());
#endif
+ GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
+
+#if defined(USE_X11) && !defined(OS_CHROMEOS)
+ // GpuDataManagerVisualProxy() just adds itself as an observer of
+ // |gpu_data_manager|, which is safe to do before Initialize().
+ gpu_data_manager_visual_proxy_.reset(
+ new internal::GpuDataManagerVisualProxy(gpu_data_manager));
+#endif
+
// 1) Need to initialize in-process GpuDataManager before creating threads.
// It's unsafe to append the gpu command line switches to the global
// CommandLine::ForCurrentProcess object after threads are created.
// 2) Must be after parts_->PreCreateThreads to pick up chrome://flags.
- GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
gpu_data_manager->Initialize();
-#if defined(USE_X11) && !defined(OS_CHROMEOS)
- gpu_data_manager_visual_proxy_.reset(
- new internal::GpuDataManagerVisualProxy(gpu_data_manager));
-#endif
-
#if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)
// Single-process is an unsupported and not fully tested mode, so
// don't enable it for official Chrome builds (except on Android).
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698