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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 CdmRegistry::GetInstance()->Init(); 872 CdmRegistry::GetInstance()->Init();
873 #endif 873 #endif
874 874
875 #if defined(OS_MACOSX) 875 #if defined(OS_MACOSX)
876 // The WindowResizeHelper allows the UI thread to wait on specific renderer 876 // The WindowResizeHelper allows the UI thread to wait on specific renderer
877 // and GPU messages from the IO thread. Initializing it before the IO thread 877 // and GPU messages from the IO thread. Initializing it before the IO thread
878 // starts ensures the affected IO thread messages always have somewhere to go. 878 // starts ensures the affected IO thread messages always have somewhere to go.
879 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); 879 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get());
880 #endif 880 #endif
881 881
882 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
883
884 #if defined(USE_X11) && !defined(OS_CHROMEOS)
885 // GpuDataManagerVisualProxy() just adds itself as an observer of
886 // |gpu_data_manager|, which is safe to do before Initialize().
887 gpu_data_manager_visual_proxy_.reset(
888 new internal::GpuDataManagerVisualProxy(gpu_data_manager));
889 #endif
890
882 // 1) Need to initialize in-process GpuDataManager before creating threads. 891 // 1) Need to initialize in-process GpuDataManager before creating threads.
883 // It's unsafe to append the gpu command line switches to the global 892 // It's unsafe to append the gpu command line switches to the global
884 // CommandLine::ForCurrentProcess object after threads are created. 893 // CommandLine::ForCurrentProcess object after threads are created.
885 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags. 894 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags.
886 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
887 gpu_data_manager->Initialize(); 895 gpu_data_manager->Initialize();
888 896
889 #if defined(USE_X11) && !defined(OS_CHROMEOS)
890 gpu_data_manager_visual_proxy_.reset(
891 new internal::GpuDataManagerVisualProxy(gpu_data_manager));
892 #endif
893
894 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID) 897 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)
895 // Single-process is an unsupported and not fully tested mode, so 898 // Single-process is an unsupported and not fully tested mode, so
896 // don't enable it for official Chrome builds (except on Android). 899 // don't enable it for official Chrome builds (except on Android).
897 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) 900 if (parsed_command_line_.HasSwitch(switches::kSingleProcess))
898 RenderProcessHost::SetRunRendererInProcess(true); 901 RenderProcessHost::SetRunRendererInProcess(true);
899 #endif 902 #endif
900 903
901 return result_code_; 904 return result_code_;
902 } 905 }
903 906
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), 1762 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
1760 MediaInternals::GetInstance()); 1763 MediaInternals::GetInstance());
1761 } 1764 }
1762 CHECK(audio_manager_); 1765 CHECK(audio_manager_);
1763 1766
1764 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); 1767 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1765 CHECK(audio_system_); 1768 CHECK(audio_system_);
1766 } 1769 }
1767 1770
1768 } // namespace content 1771 } // namespace content
OLDNEW
« 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