| OLD | NEW |
| 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 CdmRegistry::GetInstance()->Init(); | 870 CdmRegistry::GetInstance()->Init(); |
| 871 #endif | 871 #endif |
| 872 | 872 |
| 873 #if defined(OS_MACOSX) | 873 #if defined(OS_MACOSX) |
| 874 // The WindowResizeHelper allows the UI thread to wait on specific renderer | 874 // The WindowResizeHelper allows the UI thread to wait on specific renderer |
| 875 // and GPU messages from the IO thread. Initializing it before the IO thread | 875 // and GPU messages from the IO thread. Initializing it before the IO thread |
| 876 // starts ensures the affected IO thread messages always have somewhere to go. | 876 // starts ensures the affected IO thread messages always have somewhere to go. |
| 877 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); | 877 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); |
| 878 #endif | 878 #endif |
| 879 | 879 |
| 880 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
| 881 |
| 882 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 883 // GpuDataManagerVisualProxy() just adds itself as an observer of |
| 884 // |gpu_data_manager|, which is safe to do before Initialize(). |
| 885 gpu_data_manager_visual_proxy_.reset( |
| 886 new internal::GpuDataManagerVisualProxy(gpu_data_manager)); |
| 887 #endif |
| 888 |
| 880 // 1) Need to initialize in-process GpuDataManager before creating threads. | 889 // 1) Need to initialize in-process GpuDataManager before creating threads. |
| 881 // It's unsafe to append the gpu command line switches to the global | 890 // It's unsafe to append the gpu command line switches to the global |
| 882 // CommandLine::ForCurrentProcess object after threads are created. | 891 // CommandLine::ForCurrentProcess object after threads are created. |
| 883 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags. | 892 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags. |
| 884 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | |
| 885 gpu_data_manager->Initialize(); | 893 gpu_data_manager->Initialize(); |
| 886 | 894 |
| 887 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
| 888 gpu_data_manager_visual_proxy_.reset( | |
| 889 new internal::GpuDataManagerVisualProxy(gpu_data_manager)); | |
| 890 #endif | |
| 891 | |
| 892 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID) | 895 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID) |
| 893 // Single-process is an unsupported and not fully tested mode, so | 896 // Single-process is an unsupported and not fully tested mode, so |
| 894 // don't enable it for official Chrome builds (except on Android). | 897 // don't enable it for official Chrome builds (except on Android). |
| 895 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) | 898 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) |
| 896 RenderProcessHost::SetRunRendererInProcess(true); | 899 RenderProcessHost::SetRunRendererInProcess(true); |
| 897 #endif | 900 #endif |
| 898 | 901 |
| 899 return result_code_; | 902 return result_code_; |
| 900 } | 903 } |
| 901 | 904 |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 1779 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 1777 MediaInternals::GetInstance()); | 1780 MediaInternals::GetInstance()); |
| 1778 } | 1781 } |
| 1779 CHECK(audio_manager_); | 1782 CHECK(audio_manager_); |
| 1780 | 1783 |
| 1781 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1784 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
| 1782 CHECK(audio_system_); | 1785 CHECK(audio_system_); |
| 1783 } | 1786 } |
| 1784 | 1787 |
| 1785 } // namespace content | 1788 } // namespace content |
| OLD | NEW |