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

Unified Diff: components/arc/arc_bridge_service.cc

Issue 1456133005: arc-bridge: establish connections with arc video accelerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu-arc-accelerator
Patch Set: Created 5 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
« no previous file with comments | « components/arc/arc_bridge_service.h ('k') | components/arc/common/arc_host_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/arc_bridge_service.cc
diff --git a/components/arc/arc_bridge_service.cc b/components/arc/arc_bridge_service.cc
index 6565416c8a57115ecc3142bb9a2b7ccb591a010d..e884960f15bf71741599a43bb97bb4b0048cd215 100644
--- a/components/arc/arc_bridge_service.cc
+++ b/components/arc/arc_bridge_service.cc
@@ -4,6 +4,7 @@
#include "components/arc/arc_bridge_service.h"
+#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/prefs/pref_registry_simple.h"
@@ -15,6 +16,7 @@
#include "chromeos/dbus/session_manager_client.h"
#include "components/arc/common/arc_host_messages.h"
#include "components/arc/common/arc_instance_messages.h"
+#include "content/common/gpu/client/gpu_arc_accelerator_host.h"
#include "ipc/ipc_channel.h"
namespace arc {
@@ -116,6 +118,8 @@ void ArcBridgeService::StopInstance() {
}
SetState(State::STOPPING);
+ if (gpu_arc_accelerator_host_)
+ gpu_arc_accelerator_host_->Shutdown();
chromeos::SessionManagerClient* session_manager_client =
chromeos::DBusThreadManager::Get()->GetSessionManagerClient();
session_manager_client->StopArcInstance(base::Bind(
@@ -240,6 +244,24 @@ void ArcBridgeService::OnInstanceReady() {
SetState(State::READY);
}
+void ArcBridgeService::OnCreateArcVideoAccelerator(uint32_t device_type,
+ IPC::Message* reply_msg) {
+ if (!gpu_arc_accelerator_host_)
+ gpu_arc_accelerator_host_.reset(new content::GpuArcAcceleratorHost());
+
+ gpu_arc_accelerator_host_->CreateArcAccelerator(
+ device_type, base::Bind(&ArcBridgeService::ReplyCreateArcVideoAccelerator,
+ weak_factory_.GetWeakPtr(), reply_msg));
+}
+
+void ArcBridgeService::ReplyCreateArcVideoAccelerator(IPC::Message* reply_msg,
+ IPC::ChannelHandle handle,
+ uint32_t result) {
+ ArcInstanceHostMsg_CreateArcVideoAccelerator::WriteReplyParams(
+ reply_msg, handle, result);
+ ipc_channel_->Send(reply_msg);
+}
+
void ArcBridgeService::SetState(State state) {
DCHECK(origin_task_runner_->RunsTasksOnCurrentThread());
// DCHECK on enum classes not supported.
@@ -254,6 +276,9 @@ bool ArcBridgeService::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(ArcBridgeService, message)
IPC_MESSAGE_HANDLER(ArcInstanceHostMsg_InstanceReady, OnInstanceReady)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(
+ ArcInstanceHostMsg_CreateArcVideoAccelerator,
+ OnCreateArcVideoAccelerator)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -262,6 +287,10 @@ bool ArcBridgeService::OnMessageReceived(const IPC::Message& message) {
return handled;
}
+bool ArcBridgeService::Send(IPC::Message* message) {
+ return ipc_channel_->Send(message);
+}
+
void ArcBridgeService::OnArcAvailable(bool available) {
DCHECK(origin_task_runner_->RunsTasksOnCurrentThread());
if (available_ == available)
« no previous file with comments | « components/arc/arc_bridge_service.h ('k') | components/arc/common/arc_host_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698