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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 #endif | 177 #endif |
178 | 178 |
179 #if defined(ENABLE_MOJO_CDM) && defined(ENABLE_PEPPER_CDMS) | 179 #if defined(ENABLE_MOJO_CDM) && defined(ENABLE_PEPPER_CDMS) |
180 #include "content/browser/media/cdm_service_impl.h" | 180 #include "content/browser/media/cdm_service_impl.h" |
181 #endif | 181 #endif |
182 | 182 |
183 #if defined(USE_X11) | 183 #if defined(USE_X11) |
184 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 184 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
185 #include "ui/base/x/x11_util_internal.h" // nogncheck | 185 #include "ui/base/x/x11_util_internal.h" // nogncheck |
186 #include "ui/gfx/x/x11_connection.h" // nogncheck | 186 #include "ui/gfx/x/x11_connection.h" // nogncheck |
187 #include "ui/gfx/x/x11_switches.h" // nogncheck | |
188 #include "ui/gfx/x/x11_types.h" // nogncheck | 187 #include "ui/gfx/x/x11_types.h" // nogncheck |
189 #endif | 188 #endif |
190 | 189 |
191 #if defined(USE_NSS_CERTS) | 190 #if defined(USE_NSS_CERTS) |
192 #include "crypto/nss_util.h" | 191 #include "crypto/nss_util.h" |
193 #endif | 192 #endif |
194 | 193 |
195 #if defined(ENABLE_VULKAN) | 194 #if defined(ENABLE_VULKAN) |
196 #include "gpu/vulkan/vulkan_implementation.h" | 195 #include "gpu/vulkan/vulkan_implementation.h" |
197 #endif | 196 #endif |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 // starts ensures the affected IO thread messages always have somewhere to go. | 740 // starts ensures the affected IO thread messages always have somewhere to go. |
742 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); | 741 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); |
743 #endif | 742 #endif |
744 | 743 |
745 // 1) Need to initialize in-process GpuDataManager before creating threads. | 744 // 1) Need to initialize in-process GpuDataManager before creating threads. |
746 // It's unsafe to append the gpu command line switches to the global | 745 // It's unsafe to append the gpu command line switches to the global |
747 // CommandLine::ForCurrentProcess object after threads are created. | 746 // CommandLine::ForCurrentProcess object after threads are created. |
748 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags. | 747 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags. |
749 GpuDataManagerImpl::GetInstance()->Initialize(); | 748 GpuDataManagerImpl::GetInstance()->Initialize(); |
750 | 749 |
751 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
752 // PreCreateThreads is called before CreateStartupTasks which starts the gpu | |
753 // process. | |
754 bool enable_transparent_visuals = | |
755 !GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive( | |
756 gpu::DISABLE_TRANSPARENT_VISUALS); | |
757 | |
758 // Prevent this flag to be turned off later since it is only used here. | |
759 if (!enable_transparent_visuals && | |
760 !GpuDataManagerImpl::GetInstance()->IsCompleteGpuInfoAvailable()) { | |
761 base::CommandLine::ForCurrentProcess()->AppendSwitch( | |
762 "disable_transparent_visuals"); | |
763 } | |
764 | |
765 Visual* visual = NULL; | |
766 int depth = 0; | |
767 ui::ChooseVisualForWindow(enable_transparent_visuals, &visual, &depth); | |
768 DCHECK(depth > 0); | |
769 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
770 switches::kWindowDepth, base::IntToString(depth)); | |
771 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
772 switches::kX11VisualID, base::UintToString(visual->visualid)); | |
773 #endif | |
774 | |
775 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID) | 750 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID) |
776 // Single-process is an unsupported and not fully tested mode, so | 751 // Single-process is an unsupported and not fully tested mode, so |
777 // don't enable it for official Chrome builds (except on Android). | 752 // don't enable it for official Chrome builds (except on Android). |
778 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) | 753 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) |
779 RenderProcessHost::SetRunRendererInProcess(true); | 754 RenderProcessHost::SetRunRendererInProcess(true); |
780 #endif | 755 #endif |
781 | 756 |
782 return result_code_; | 757 return result_code_; |
783 } | 758 } |
784 | 759 |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1518 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
1544 audio_thread_->task_runner(); | 1519 audio_thread_->task_runner(); |
1545 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1520 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
1546 std::move(worker_task_runner), | 1521 std::move(worker_task_runner), |
1547 MediaInternals::GetInstance()); | 1522 MediaInternals::GetInstance()); |
1548 } | 1523 } |
1549 CHECK(audio_manager_); | 1524 CHECK(audio_manager_); |
1550 } | 1525 } |
1551 | 1526 |
1552 } // namespace content | 1527 } // namespace content |
OLD | NEW |