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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include "mojo/edk/embedder/scoped_ipc_support.h" | 98 #include "mojo/edk/embedder/scoped_ipc_support.h" |
99 #include "net/base/network_change_notifier.h" | 99 #include "net/base/network_change_notifier.h" |
100 #include "net/socket/client_socket_factory.h" | 100 #include "net/socket/client_socket_factory.h" |
101 #include "net/ssl/ssl_config_service.h" | 101 #include "net/ssl/ssl_config_service.h" |
102 #include "ppapi/features/features.h" | 102 #include "ppapi/features/features.h" |
103 #include "services/service_manager/runner/common/client_util.h" | 103 #include "services/service_manager/runner/common/client_util.h" |
104 #include "skia/ext/event_tracer_impl.h" | 104 #include "skia/ext/event_tracer_impl.h" |
105 #include "skia/ext/skia_memory_dump_provider.h" | 105 #include "skia/ext/skia_memory_dump_provider.h" |
106 #include "sql/sql_memory_dump_provider.h" | 106 #include "sql/sql_memory_dump_provider.h" |
107 #include "ui/base/clipboard/clipboard.h" | 107 #include "ui/base/clipboard/clipboard.h" |
| 108 #include "ui/gfx/switches.h" |
108 | 109 |
109 #if defined(USE_AURA) || defined(OS_MACOSX) | 110 #if defined(USE_AURA) || defined(OS_MACOSX) |
110 #include "content/browser/compositor/image_transport_factory.h" | 111 #include "content/browser/compositor/image_transport_factory.h" |
111 #endif | 112 #endif |
112 | 113 |
113 #if defined(USE_AURA) | 114 #if defined(USE_AURA) |
114 #include "content/public/browser/context_factory.h" | 115 #include "content/public/browser/context_factory.h" |
115 #include "ui/aura/env.h" | 116 #include "ui/aura/env.h" |
116 #endif | 117 #endif |
117 | 118 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 explicit GpuDataManagerVisualProxy(GpuDataManagerImpl* gpu_data_manager) | 457 explicit GpuDataManagerVisualProxy(GpuDataManagerImpl* gpu_data_manager) |
457 : gpu_data_manager_(gpu_data_manager) { | 458 : gpu_data_manager_(gpu_data_manager) { |
458 gpu_data_manager_->AddObserver(this); | 459 gpu_data_manager_->AddObserver(this); |
459 } | 460 } |
460 | 461 |
461 ~GpuDataManagerVisualProxy() override { | 462 ~GpuDataManagerVisualProxy() override { |
462 gpu_data_manager_->RemoveObserver(this); | 463 gpu_data_manager_->RemoveObserver(this); |
463 } | 464 } |
464 | 465 |
465 void OnGpuInfoUpdate() override { | 466 void OnGpuInfoUpdate() override { |
| 467 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless)) |
| 468 return; |
466 gpu::GPUInfo gpu_info = gpu_data_manager_->GetGPUInfo(); | 469 gpu::GPUInfo gpu_info = gpu_data_manager_->GetGPUInfo(); |
467 if (!ui::XVisualManager::GetInstance()->OnGPUInfoChanged( | 470 if (!ui::XVisualManager::GetInstance()->OnGPUInfoChanged( |
468 gpu_info.software_rendering || | 471 gpu_info.software_rendering || |
469 !gpu_data_manager_->GpuAccessAllowed(nullptr), | 472 !gpu_data_manager_->GpuAccessAllowed(nullptr), |
470 gpu_info.system_visual, gpu_info.rgba_visual)) { | 473 gpu_info.system_visual, gpu_info.rgba_visual)) { |
471 // The GPU process sent back bad visuals, which should never happen. | 474 // The GPU process sent back bad visuals, which should never happen. |
472 auto* gpu_process_host = GpuProcessHost::Get( | 475 auto* gpu_process_host = GpuProcessHost::Get( |
473 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false); | 476 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false); |
474 if (gpu_process_host) | 477 if (gpu_process_host) |
475 gpu_process_host->ForceShutdown(); | 478 gpu_process_host->ForceShutdown(); |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 INITCOMMONCONTROLSEX config; | 1565 INITCOMMONCONTROLSEX config; |
1563 config.dwSize = sizeof(config); | 1566 config.dwSize = sizeof(config); |
1564 config.dwICC = ICC_WIN95_CLASSES; | 1567 config.dwICC = ICC_WIN95_CLASSES; |
1565 if (!InitCommonControlsEx(&config)) | 1568 if (!InitCommonControlsEx(&config)) |
1566 PLOG(FATAL); | 1569 PLOG(FATAL); |
1567 #endif | 1570 #endif |
1568 | 1571 |
1569 #if defined(USE_AURA) | 1572 #if defined(USE_AURA) |
1570 | 1573 |
1571 #if defined(USE_X11) | 1574 #if defined(USE_X11) |
1572 if (!gfx::GetXDisplay()) { | 1575 if (!parsed_command_line_.HasSwitch(switches::kHeadless) && |
| 1576 !gfx::GetXDisplay()) { |
1573 LOG(ERROR) << "Unable to open X display."; | 1577 LOG(ERROR) << "Unable to open X display."; |
1574 return false; | 1578 return false; |
1575 } | 1579 } |
1576 #endif | 1580 #endif |
1577 | 1581 |
1578 // Env creates the compositor. Aura widgets need the compositor to be created | 1582 // Env creates the compositor. Aura widgets need the compositor to be created |
1579 // before they can be initialized by the browser. | 1583 // before they can be initialized by the browser. |
1580 env_ = aura::Env::CreateInstance(parameters_.env_mode); | 1584 env_ = aura::Env::CreateInstance(parameters_.env_mode); |
1581 #endif // defined(USE_AURA) | 1585 #endif // defined(USE_AURA) |
1582 | 1586 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1701 if (!audio_manager_) { | 1705 if (!audio_manager_) { |
1702 audio_thread_ = base::MakeUnique<AudioDeviceThread>(); | 1706 audio_thread_ = base::MakeUnique<AudioDeviceThread>(); |
1703 audio_manager_ = media::AudioManager::Create( | 1707 audio_manager_ = media::AudioManager::Create( |
1704 audio_thread_->GetTaskRunner(), audio_thread_->worker_task_runner(), | 1708 audio_thread_->GetTaskRunner(), audio_thread_->worker_task_runner(), |
1705 MediaInternals::GetInstance()); | 1709 MediaInternals::GetInstance()); |
1706 } | 1710 } |
1707 CHECK(audio_manager_); | 1711 CHECK(audio_manager_); |
1708 } | 1712 } |
1709 | 1713 |
1710 } // namespace content | 1714 } // namespace content |
OLD | NEW |