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

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 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
« no previous file with comments | « chrome/app/chrome_main.cc ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « chrome/app/chrome_main.cc ('k') | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698