Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index d6b6f98a3ea2427082b0d96fc5b40988cc6608fe..5594c92bf14cbb23daf04dc536862169ea7b8b22 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -100,6 +100,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" |
@@ -393,6 +394,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 || |
@@ -1477,7 +1480,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; |
} |