Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: content/browser/browser_main_loop.cc

Issue 1991953002: Implement a runtime headless mode for Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0cf40d25a210cb205e1053b42aba19003b4d3e67 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -394,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 ||
@@ -1479,7 +1481,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;
}

Powered by Google App Engine
This is Rietveld 408576698