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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #include "mojo/edk/embedder/scoped_ipc_support.h" | 93 #include "mojo/edk/embedder/scoped_ipc_support.h" |
94 #include "net/base/network_change_notifier.h" | 94 #include "net/base/network_change_notifier.h" |
95 #include "net/socket/client_socket_factory.h" | 95 #include "net/socket/client_socket_factory.h" |
96 #include "net/ssl/ssl_config_service.h" | 96 #include "net/ssl/ssl_config_service.h" |
97 #include "ppapi/features/features.h" | 97 #include "ppapi/features/features.h" |
98 #include "services/service_manager/runner/common/client_util.h" | 98 #include "services/service_manager/runner/common/client_util.h" |
99 #include "skia/ext/event_tracer_impl.h" | 99 #include "skia/ext/event_tracer_impl.h" |
100 #include "skia/ext/skia_memory_dump_provider.h" | 100 #include "skia/ext/skia_memory_dump_provider.h" |
101 #include "sql/sql_memory_dump_provider.h" | 101 #include "sql/sql_memory_dump_provider.h" |
102 #include "ui/base/clipboard/clipboard.h" | 102 #include "ui/base/clipboard/clipboard.h" |
| 103 #include "ui/gfx/switches.h" |
103 | 104 |
104 #if defined(USE_AURA) || defined(OS_MACOSX) | 105 #if defined(USE_AURA) || defined(OS_MACOSX) |
105 #include "content/browser/compositor/image_transport_factory.h" | 106 #include "content/browser/compositor/image_transport_factory.h" |
106 #endif | 107 #endif |
107 | 108 |
108 #if defined(USE_AURA) | 109 #if defined(USE_AURA) |
109 #include "content/public/browser/context_factory.h" | 110 #include "content/public/browser/context_factory.h" |
110 #include "ui/aura/env.h" | 111 #include "ui/aura/env.h" |
111 #endif | 112 #endif |
112 | 113 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 explicit GpuDataManagerVisualProxy(GpuDataManagerImpl* gpu_data_manager) | 387 explicit GpuDataManagerVisualProxy(GpuDataManagerImpl* gpu_data_manager) |
387 : gpu_data_manager_(gpu_data_manager) { | 388 : gpu_data_manager_(gpu_data_manager) { |
388 gpu_data_manager_->AddObserver(this); | 389 gpu_data_manager_->AddObserver(this); |
389 } | 390 } |
390 | 391 |
391 ~GpuDataManagerVisualProxy() override { | 392 ~GpuDataManagerVisualProxy() override { |
392 gpu_data_manager_->RemoveObserver(this); | 393 gpu_data_manager_->RemoveObserver(this); |
393 } | 394 } |
394 | 395 |
395 void OnGpuInfoUpdate() override { | 396 void OnGpuInfoUpdate() override { |
| 397 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless)) |
| 398 return; |
396 gpu::GPUInfo gpu_info = gpu_data_manager_->GetGPUInfo(); | 399 gpu::GPUInfo gpu_info = gpu_data_manager_->GetGPUInfo(); |
397 if (!ui::XVisualManager::GetInstance()->OnGPUInfoChanged( | 400 if (!ui::XVisualManager::GetInstance()->OnGPUInfoChanged( |
398 gpu_info.software_rendering || | 401 gpu_info.software_rendering || |
399 !gpu_data_manager_->GpuAccessAllowed(nullptr), | 402 !gpu_data_manager_->GpuAccessAllowed(nullptr), |
400 gpu_info.system_visual, gpu_info.rgba_visual)) { | 403 gpu_info.system_visual, gpu_info.rgba_visual)) { |
401 // The GPU process sent back bad visuals, which should never happen. | 404 // The GPU process sent back bad visuals, which should never happen. |
402 auto* gpu_process_host = GpuProcessHost::Get( | 405 auto* gpu_process_host = GpuProcessHost::Get( |
403 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false); | 406 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false); |
404 if (gpu_process_host) | 407 if (gpu_process_host) |
405 gpu_process_host->ForceShutdown(); | 408 gpu_process_host->ForceShutdown(); |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 INITCOMMONCONTROLSEX config; | 1473 INITCOMMONCONTROLSEX config; |
1471 config.dwSize = sizeof(config); | 1474 config.dwSize = sizeof(config); |
1472 config.dwICC = ICC_WIN95_CLASSES; | 1475 config.dwICC = ICC_WIN95_CLASSES; |
1473 if (!InitCommonControlsEx(&config)) | 1476 if (!InitCommonControlsEx(&config)) |
1474 PLOG(FATAL); | 1477 PLOG(FATAL); |
1475 #endif | 1478 #endif |
1476 | 1479 |
1477 #if defined(USE_AURA) | 1480 #if defined(USE_AURA) |
1478 | 1481 |
1479 #if defined(USE_X11) | 1482 #if defined(USE_X11) |
1480 if (!gfx::GetXDisplay()) { | 1483 if (!parsed_command_line_.HasSwitch(switches::kHeadless) && |
| 1484 !gfx::GetXDisplay()) { |
1481 LOG(ERROR) << "Unable to open X display."; | 1485 LOG(ERROR) << "Unable to open X display."; |
1482 return false; | 1486 return false; |
1483 } | 1487 } |
1484 #endif | 1488 #endif |
1485 | 1489 |
1486 // Env creates the compositor. Aura widgets need the compositor to be created | 1490 // Env creates the compositor. Aura widgets need the compositor to be created |
1487 // before they can be initialized by the browser. | 1491 // before they can be initialized by the browser. |
1488 env_ = aura::Env::CreateInstance(); | 1492 env_ = aura::Env::CreateInstance(); |
1489 #endif // defined(USE_AURA) | 1493 #endif // defined(USE_AURA) |
1490 | 1494 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 if (!audio_manager_) { | 1613 if (!audio_manager_) { |
1610 audio_thread_ = base::MakeUnique<AudioDeviceThread>(); | 1614 audio_thread_ = base::MakeUnique<AudioDeviceThread>(); |
1611 audio_manager_ = media::AudioManager::Create( | 1615 audio_manager_ = media::AudioManager::Create( |
1612 audio_thread_->GetTaskRunner(), audio_thread_->worker_task_runner(), | 1616 audio_thread_->GetTaskRunner(), audio_thread_->worker_task_runner(), |
1613 MediaInternals::GetInstance()); | 1617 MediaInternals::GetInstance()); |
1614 } | 1618 } |
1615 CHECK(audio_manager_); | 1619 CHECK(audio_manager_); |
1616 } | 1620 } |
1617 | 1621 |
1618 } // namespace content | 1622 } // namespace content |
OLD | NEW |