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

Unified Diff: services/ui/gpu/gpu_main.cc

Issue 2289553002: gpu: Introduce GpuInit. (Closed)
Patch Set: . Created 4 years, 3 months 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 | « services/ui/gpu/gpu_main.h ('k') | services/ui/gpu/gpu_service_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/gpu/gpu_main.cc
diff --git a/services/ui/gpu/gpu_main.cc b/services/ui/gpu/gpu_main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9764dd3763852a2e721d5fe33c79186f24946de2
--- /dev/null
+++ b/services/ui/gpu/gpu_main.cc
@@ -0,0 +1,66 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "services/ui/gpu/gpu_main.h"
+
+#include "base/command_line.h"
+#include "services/ui/gpu/gpu_service_internal.h"
+
+namespace ui {
+
+GpuMain::GpuMain() : gpu_init_(this, *base::CommandLine::ForCurrentProcess()) {
+ DCHECK(gpu_service_internal_);
+}
+
+GpuMain::~GpuMain() {}
+
+void GpuMain::Add(mojom::GpuServiceInternalRequest request) {
+ gpu_service_internal_->Add(std::move(request));
+}
+
+void GpuMain::OnGpuInfoUpdate(const gpu::GPUInfo& gpu_info) {
+ gpu_info_ = gpu_info;
+}
+
+void GpuMain::OnGpuWatchdogThreadCreated(gpu::GpuWatchdogThread* thread) {
+ watchdog_thread_ = thread;
+}
+
+void GpuMain::OnGpuWatchdogThreadDestroyed() {
+ watchdog_thread_ = nullptr;
+}
+
+bool GpuMain::ShouldInitializeGL() {
+ // TODO(sad): GL is currently initialized by WS. Once the gpu moves into a
+ // separate process, this should return true.
+ return false;
+}
+
+void GpuMain::WaitForDebugger() {
+ NOTIMPLEMENTED();
+}
+
+void GpuMain::PreSandboxInitialization() {}
+
+bool GpuMain::ShouldStartSandboxEarly() {
+ return false;
+}
+
+void GpuMain::WarmUpSandbox() {}
+
+bool GpuMain::StartSandbox() {
+ return true;
+}
+
+void GpuMain::InitializeMessageLoop() {}
+
+void GpuMain::Initialize(base::Time start_time,
+ bool dead_on_arrival,
+ std::vector<gpu::GpuInitLogMessage> int_log_messages,
+ gpu::GpuMemoryBufferFactory* gpu_buffer_factory) {
+ gpu_service_internal_.reset(
+ new GpuServiceInternal(watchdog_thread_, gpu_buffer_factory));
+}
+
+} // namespace ui
« no previous file with comments | « services/ui/gpu/gpu_main.h ('k') | services/ui/gpu/gpu_service_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698