Chromium Code Reviews| Index: chrome/browser/chrome_browser_main.cc |
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
| index b264d2070d447470b61e36a69f4a7a746825b9c2..ce74ff896d8e9ebc41634a7c53795b2566982eca 100644 |
| --- a/chrome/browser/chrome_browser_main.cc |
| +++ b/chrome/browser/chrome_browser_main.cc |
| @@ -1132,6 +1132,23 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { |
| return content::RESULT_CODE_NORMAL_EXIT; |
| } |
| +void ChromeBrowserMainParts::PreCreateThreadsEnd() { |
| + // GpuDataManagerImpl::GetInstance()->Initialize(); is called at the end of |
| + // BrowserMainLoop::PreCreateThreads() so it is wrong to call the 2 following |
| + // function in this->PreCreateThreads(). Otherwise it will access the gpu |
| + // data manager before initializing it. |
| + // Alternatively we could ensure that content::GpuDataManager::GetInstance() |
|
Zhenyao Mo
2016/01/05 18:04:44
No, we want to be explicit where and when Initiali
|
| + // internally calls GpuDataManagerImpl::GetInstance()->Initialize(). |
| + |
| + // Retrieve cached GL strings from local state and use them for GPU |
| + // blacklist decisions. |
| + if (g_browser_process->gl_string_manager()) |
| + g_browser_process->gl_string_manager()->Initialize(); |
| + |
| + // Create an instance of GpuModeManager to watch gpu mode pref change. |
| + g_browser_process->gpu_mode_manager(); |
| +} |
| + |
| void ChromeBrowserMainParts::PreMainMessageLoopRun() { |
| TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRun"); |
| TRACK_SCOPED_REGION( |
| @@ -1502,14 +1519,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { |
| // (requires supporting early exit). |
| PostProfileInit(); |
| - // Retrieve cached GL strings from local state and use them for GPU |
| - // blacklist decisions. |
| - if (g_browser_process->gl_string_manager()) |
| - g_browser_process->gl_string_manager()->Initialize(); |
| - |
| - // Create an instance of GpuModeManager to watch gpu mode pref change. |
| - g_browser_process->gpu_mode_manager(); |
| - |
| #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
| // Show the First Run UI if this is the first time Chrome has been run on |
| // this computer, or we're being compelled to do so by a command line flag. |