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

Side by Side 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: Mac build fix 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 #include "mojo/edk/embedder/scoped_ipc_support.h" 92 #include "mojo/edk/embedder/scoped_ipc_support.h"
93 #include "net/base/network_change_notifier.h" 93 #include "net/base/network_change_notifier.h"
94 #include "net/socket/client_socket_factory.h" 94 #include "net/socket/client_socket_factory.h"
95 #include "net/ssl/ssl_config_service.h" 95 #include "net/ssl/ssl_config_service.h"
96 #include "ppapi/features/features.h" 96 #include "ppapi/features/features.h"
97 #include "services/service_manager/runner/common/client_util.h" 97 #include "services/service_manager/runner/common/client_util.h"
98 #include "skia/ext/event_tracer_impl.h" 98 #include "skia/ext/event_tracer_impl.h"
99 #include "skia/ext/skia_memory_dump_provider.h" 99 #include "skia/ext/skia_memory_dump_provider.h"
100 #include "sql/sql_memory_dump_provider.h" 100 #include "sql/sql_memory_dump_provider.h"
101 #include "ui/base/clipboard/clipboard.h" 101 #include "ui/base/clipboard/clipboard.h"
102 #include "ui/gfx/switches.h"
102 103
103 #if defined(USE_AURA) || defined(OS_MACOSX) 104 #if defined(USE_AURA) || defined(OS_MACOSX)
104 #include "content/browser/compositor/image_transport_factory.h" 105 #include "content/browser/compositor/image_transport_factory.h"
105 #endif 106 #endif
106 107
107 #if defined(USE_AURA) 108 #if defined(USE_AURA)
108 #include "content/public/browser/context_factory.h" 109 #include "content/public/browser/context_factory.h"
109 #include "ui/aura/env.h" 110 #include "ui/aura/env.h"
110 #endif 111 #endif
111 112
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 explicit GpuDataManagerVisualProxy(GpuDataManagerImpl* gpu_data_manager) 388 explicit GpuDataManagerVisualProxy(GpuDataManagerImpl* gpu_data_manager)
388 : gpu_data_manager_(gpu_data_manager) { 389 : gpu_data_manager_(gpu_data_manager) {
389 gpu_data_manager_->AddObserver(this); 390 gpu_data_manager_->AddObserver(this);
390 } 391 }
391 392
392 ~GpuDataManagerVisualProxy() override { 393 ~GpuDataManagerVisualProxy() override {
393 gpu_data_manager_->RemoveObserver(this); 394 gpu_data_manager_->RemoveObserver(this);
394 } 395 }
395 396
396 void OnGpuInfoUpdate() override { 397 void OnGpuInfoUpdate() override {
398 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless))
399 return;
397 gpu::GPUInfo gpu_info = gpu_data_manager_->GetGPUInfo(); 400 gpu::GPUInfo gpu_info = gpu_data_manager_->GetGPUInfo();
398 if (!ui::XVisualManager::GetInstance()->OnGPUInfoChanged( 401 if (!ui::XVisualManager::GetInstance()->OnGPUInfoChanged(
399 gpu_info.software_rendering || 402 gpu_info.software_rendering ||
400 !gpu_data_manager_->GpuAccessAllowed(nullptr), 403 !gpu_data_manager_->GpuAccessAllowed(nullptr),
401 gpu_info.system_visual, gpu_info.rgba_visual)) { 404 gpu_info.system_visual, gpu_info.rgba_visual)) {
402 // The GPU process sent back bad visuals, which should never happen. 405 // The GPU process sent back bad visuals, which should never happen.
403 auto* gpu_process_host = GpuProcessHost::Get( 406 auto* gpu_process_host = GpuProcessHost::Get(
404 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false); 407 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false);
405 if (gpu_process_host) 408 if (gpu_process_host)
406 gpu_process_host->ForceShutdown(); 409 gpu_process_host->ForceShutdown();
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 INITCOMMONCONTROLSEX config; 1475 INITCOMMONCONTROLSEX config;
1473 config.dwSize = sizeof(config); 1476 config.dwSize = sizeof(config);
1474 config.dwICC = ICC_WIN95_CLASSES; 1477 config.dwICC = ICC_WIN95_CLASSES;
1475 if (!InitCommonControlsEx(&config)) 1478 if (!InitCommonControlsEx(&config))
1476 PLOG(FATAL); 1479 PLOG(FATAL);
1477 #endif 1480 #endif
1478 1481
1479 #if defined(USE_AURA) 1482 #if defined(USE_AURA)
1480 1483
1481 #if defined(USE_X11) 1484 #if defined(USE_X11)
1482 if (!gfx::GetXDisplay()) { 1485 if (!parsed_command_line_.HasSwitch(switches::kHeadless) &&
1486 !gfx::GetXDisplay()) {
1483 LOG(ERROR) << "Unable to open X display."; 1487 LOG(ERROR) << "Unable to open X display.";
1484 return false; 1488 return false;
1485 } 1489 }
1486 #endif 1490 #endif
1487 1491
1488 // Env creates the compositor. Aura widgets need the compositor to be created 1492 // Env creates the compositor. Aura widgets need the compositor to be created
1489 // before they can be initialized by the browser. 1493 // before they can be initialized by the browser.
1490 env_ = aura::Env::CreateInstance(); 1494 env_ = aura::Env::CreateInstance();
1491 #endif // defined(USE_AURA) 1495 #endif // defined(USE_AURA)
1492 1496
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = 1630 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner =
1627 audio_thread_->task_runner(); 1631 audio_thread_->task_runner();
1628 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), 1632 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner),
1629 std::move(worker_task_runner), 1633 std::move(worker_task_runner),
1630 MediaInternals::GetInstance()); 1634 MediaInternals::GetInstance());
1631 } 1635 }
1632 CHECK(audio_manager_); 1636 CHECK(audio_manager_);
1633 } 1637 }
1634 1638
1635 } // namespace content 1639 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698