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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 | 171 |
172 #if defined(ENABLE_PLUGINS) | 172 #if defined(ENABLE_PLUGINS) |
173 #include "content/browser/plugin_service_impl.h" | 173 #include "content/browser/plugin_service_impl.h" |
174 #endif | 174 #endif |
175 | 175 |
176 #if defined(ENABLE_MOJO_CDM) && defined(ENABLE_PEPPER_CDMS) | 176 #if defined(ENABLE_MOJO_CDM) && defined(ENABLE_PEPPER_CDMS) |
177 #include "content/browser/media/cdm_service_impl.h" | 177 #include "content/browser/media/cdm_service_impl.h" |
178 #endif | 178 #endif |
179 | 179 |
180 #if defined(USE_X11) | 180 #if defined(USE_X11) |
181 #include "gpu/config/gpu_driver_bug_workaround_type.h" | |
181 #include "ui/base/x/x11_util_internal.h" // nogncheck | 182 #include "ui/base/x/x11_util_internal.h" // nogncheck |
182 #include "ui/gfx/x/x11_connection.h" // nogncheck | 183 #include "ui/gfx/x/x11_connection.h" // nogncheck |
183 #include "ui/gfx/x/x11_switches.h" // nogncheck | 184 #include "ui/gfx/x/x11_switches.h" // nogncheck |
184 #include "ui/gfx/x/x11_types.h" // nogncheck | 185 #include "ui/gfx/x/x11_types.h" // nogncheck |
185 #endif | 186 #endif |
186 | 187 |
187 #if defined(USE_NSS_CERTS) | 188 #if defined(USE_NSS_CERTS) |
188 #include "crypto/nss_util.h" | 189 #include "crypto/nss_util.h" |
189 #endif | 190 #endif |
190 | 191 |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
750 // starts ensures the affected IO thread messages always have somewhere to go. | 751 // starts ensures the affected IO thread messages always have somewhere to go. |
751 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); | 752 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); |
752 #endif | 753 #endif |
753 | 754 |
754 // 1) Need to initialize in-process GpuDataManager before creating threads. | 755 // 1) Need to initialize in-process GpuDataManager before creating threads. |
755 // It's unsafe to append the gpu command line switches to the global | 756 // It's unsafe to append the gpu command line switches to the global |
756 // CommandLine::ForCurrentProcess object after threads are created. | 757 // CommandLine::ForCurrentProcess object after threads are created. |
757 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags. | 758 // 2) Must be after parts_->PreCreateThreads to pick up chrome://flags. |
758 GpuDataManagerImpl::GetInstance()->Initialize(); | 759 GpuDataManagerImpl::GetInstance()->Initialize(); |
759 | 760 |
761 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
762 // PreCreateThreads is called before CreateStartupTasks which one starts the | |
Corentin Wallez
2016/07/07 00:09:23
nit: which one -> which
Julien Isorce Samsung
2016/07/07 10:29:23
Done.
| |
763 // gpu process. | |
764 bool disable_transparent_visuals = | |
765 GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive( | |
766 gpu::DISABLE_TRANSPARENT_VISUALS); | |
767 Visual* visual = NULL; | |
768 int depth = 0; | |
769 ui::ChooseVisualForWindow(disable_transparent_visuals, &visual, &depth); | |
770 DCHECK(depth > 0); | |
771 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
772 switches::kWindowDepth, base::IntToString(depth)); | |
773 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
774 switches::kX11VisualID, base::UintToString(visual->visualid)); | |
775 #endif | |
776 | |
760 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID) | 777 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID) |
761 // Single-process is an unsupported and not fully tested mode, so | 778 // Single-process is an unsupported and not fully tested mode, so |
762 // don't enable it for official Chrome builds (except on Android). | 779 // don't enable it for official Chrome builds (except on Android). |
763 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) | 780 if (parsed_command_line_.HasSwitch(switches::kSingleProcess)) |
764 RenderProcessHost::SetRunRendererInProcess(true); | 781 RenderProcessHost::SetRunRendererInProcess(true); |
765 #endif | 782 #endif |
766 | 783 |
767 return result_code_; | 784 return result_code_; |
768 } | 785 } |
769 | 786 |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1370 PLOG(FATAL); | 1387 PLOG(FATAL); |
1371 #endif | 1388 #endif |
1372 | 1389 |
1373 #if defined(USE_AURA) | 1390 #if defined(USE_AURA) |
1374 | 1391 |
1375 #if defined(USE_X11) | 1392 #if defined(USE_X11) |
1376 if (!gfx::GetXDisplay()) { | 1393 if (!gfx::GetXDisplay()) { |
1377 LOG(ERROR) << "Unable to open X display."; | 1394 LOG(ERROR) << "Unable to open X display."; |
1378 return false; | 1395 return false; |
1379 } | 1396 } |
1380 | |
1381 #if !defined(OS_CHROMEOS) | |
1382 // InitializeToolkit is called before CreateStartupTasks which one starts the | |
1383 // gpu process. | |
1384 Visual* visual = NULL; | |
1385 int depth = 0; | |
1386 ui::ChooseVisualForWindow(&visual, &depth); | |
1387 DCHECK(depth > 0); | |
1388 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
1389 switches::kWindowDepth, base::IntToString(depth)); | |
1390 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
1391 switches::kX11VisualID, base::UintToString(visual->visualid)); | |
1392 #endif | |
1393 | |
1394 #endif | 1397 #endif |
1395 | 1398 |
1396 // Env creates the compositor. Aura widgets need the compositor to be created | 1399 // Env creates the compositor. Aura widgets need the compositor to be created |
1397 // before they can be initialized by the browser. | 1400 // before they can be initialized by the browser. |
1398 env_ = aura::Env::CreateInstance(); | 1401 env_ = aura::Env::CreateInstance(); |
1399 #endif // defined(USE_AURA) | 1402 #endif // defined(USE_AURA) |
1400 | 1403 |
1401 if (parts_) | 1404 if (parts_) |
1402 parts_->ToolkitInitialized(); | 1405 parts_->ToolkitInitialized(); |
1403 | 1406 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1517 std::move(worker_task_runner), | 1520 std::move(worker_task_runner), |
1518 MediaInternals::GetInstance()); | 1521 MediaInternals::GetInstance()); |
1519 } | 1522 } |
1520 CHECK(audio_manager_); | 1523 CHECK(audio_manager_); |
1521 | 1524 |
1522 if (use_hang_monitor) | 1525 if (use_hang_monitor) |
1523 media::AudioManager::StartHangMonitor(io_thread_->task_runner()); | 1526 media::AudioManager::StartHangMonitor(io_thread_->task_runner()); |
1524 } | 1527 } |
1525 | 1528 |
1526 } // namespace content | 1529 } // namespace content |
OLD | NEW |