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

Unified Diff: chrome/gpu/chrome_content_gpu_client.cc

Issue 1641353003: GpuArcVideoService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@arc-4-owen-ArcGpuVideoDecodeAccelerator
Patch Set: modify content gui client hook Created 4 years, 9 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
Index: chrome/gpu/chrome_content_gpu_client.cc
diff --git a/chrome/gpu/chrome_content_gpu_client.cc b/chrome/gpu/chrome_content_gpu_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4e8a9950f159fa2de56b41afcb5b5516cac32a67
--- /dev/null
+++ b/chrome/gpu/chrome_content_gpu_client.cc
@@ -0,0 +1,40 @@
+// 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 "chrome/gpu/chrome_content_gpu_client.h"
+
+#include "content/public/common/service_registry.h"
+
+#if defined(OS_CHROMEOS)
+#include "chrome/gpu/gpu_arc_video_service.h"
+#include "gpu/command_buffer/service/gpu_preferences.h"
+#endif
+
+#if defined(OS_CHROMEOS)
+namespace {
+
+void CreateGpuArcVideoService(
+ const gpu::GpuPreferences& gpu_preferences,
+ mojo::InterfaceRequest<::arc::VideoHost> request) {
+ // GpuArcVideoService is strongly bound to the Mojo message pipe it
+ // is connected to. When that message pipe is closed, either explicitly on the
+ // other end (in the browser process), or by a connection error, this object
+ // will be destroyed.
+ new chromeos::arc::GpuArcVideoService(std::move(request), gpu_preferences);
+}
+
+} // namespace
+#endif
+
+ChromeContentGpuClient::ChromeContentGpuClient() {}
+
+ChromeContentGpuClient::~ChromeContentGpuClient() {}
+
+void ChromeContentGpuClient::RegisterMojoServices(
+ content::ServiceRegistry* registry,
+ const gpu::GpuPreferences& gpu_preferences) {
+#if defined(OS_CHROMEOS)
+ registry->AddService(base::Bind(&CreateGpuArcVideoService, gpu_preferences));
+#endif
+}

Powered by Google App Engine
This is Rietveld 408576698