| Index: content/browser/browser_main_loop.cc
|
| diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
|
| index 86a5d31e2073c47e72ef333a56bdd18084e8d28e..5e6338c73dde73f996ef05f7cef2f8e3865f69a6 100644
|
| --- a/content/browser/browser_main_loop.cc
|
| +++ b/content/browser/browser_main_loop.cc
|
| @@ -99,6 +99,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"
|
| @@ -394,6 +395,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 ||
|
| @@ -1479,7 +1482,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;
|
| }
|
|
|