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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2894673009: [Merge to M59] Initialize GpuDataManagerImpl after GpuDataManagerVisualProxy (Closed)
Patch Set: 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 8ca5ddd32b3c8e9a1cd8a0628ab95f78b7160436..bb49a9a15191982b476df6facd7662c1dfb20356 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -879,18 +879,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