| Index: content/browser/browser_main_loop.cc
|
| diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
|
| index 7f1e484b4416078fd3acbe141bfe4dae80cd7a29..19e5674f99afb148e52da40c097139ace7bfc3ca 100644
|
| --- a/content/browser/browser_main_loop.cc
|
| +++ b/content/browser/browser_main_loop.cc
|
| @@ -105,6 +105,7 @@
|
| #include "skia/ext/skia_memory_dump_provider.h"
|
| #include "sql/sql_memory_dump_provider.h"
|
| #include "ui/base/clipboard/clipboard.h"
|
| +#include "ui/gfx/switches.h"
|
|
|
| #if defined(USE_AURA) || defined(OS_MACOSX)
|
| #include "content/browser/compositor/image_transport_factory.h"
|
| @@ -463,6 +464,8 @@ class GpuDataManagerVisualProxy : public GpuDataManagerObserver {
|
| }
|
|
|
| void OnGpuInfoUpdate() override {
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless))
|
| + return;
|
| gpu::GPUInfo gpu_info = gpu_data_manager_->GetGPUInfo();
|
| if (!ui::XVisualManager::GetInstance()->OnGPUInfoChanged(
|
| gpu_info.software_rendering ||
|
| @@ -1569,7 +1572,8 @@ bool BrowserMainLoop::InitializeToolkit() {
|
| #if defined(USE_AURA)
|
|
|
| #if defined(USE_X11)
|
| - if (!gfx::GetXDisplay()) {
|
| + if (!parsed_command_line_.HasSwitch(switches::kHeadless) &&
|
| + !gfx::GetXDisplay()) {
|
| LOG(ERROR) << "Unable to open X display.";
|
| return false;
|
| }
|
|
|