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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 1736643005: Decouple Media Service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit + fixed compile issue Created 4 years, 10 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 | « content/gpu/gpu_child_thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_child_thread.cc
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 74f041fba10aaef91124426c791a27890466bd8d..1bb3df07e35f42846c9f352ac69012eda1b1bc1c 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -18,6 +18,7 @@
#include "content/common/gpu/gpu_host_messages.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "content/common/gpu/media/gpu_video_decode_accelerator.h"
+#include "content/common/gpu/media/media_service.h"
#include "content/gpu/gpu_process_control_impl.h"
#include "content/gpu/gpu_watchdog_thread.h"
#include "content/public/common/content_client.h"
@@ -302,6 +303,7 @@ void GpuChildThread::DidCreateOffscreenContext(const GURL& active_url) {
}
void GpuChildThread::DidDestroyChannel(int client_id) {
+ media_service_->RemoveChannel(client_id);
Send(new GpuHostMsg_DestroyChannel(client_id));
}
@@ -377,6 +379,8 @@ void GpuChildThread::OnInitialize() {
ChildProcess::current()->GetShutDownEvent(),
sync_point_manager_, gpu_memory_buffer_factory_));
+ media_service_.reset(new MediaService(gpu_channel_manager_.get()));
+
#if defined(USE_OZONE)
ui::OzonePlatform::GetInstance()
->GetGpuPlatformSupport()
@@ -565,6 +569,7 @@ void GpuChildThread::OnEstablishChannel(const EstablishChannelParams& params) {
IPC::ChannelHandle channel_handle =
gpu_channel_manager_->EstablishChannel(params);
+ media_service_->AddChannel(params.client_id);
Send(new GpuHostMsg_ChannelEstablished(channel_handle));
}
@@ -601,8 +606,10 @@ void GpuChildThread::OnWakeUpGpu() {
#endif
void GpuChildThread::OnLoseAllContexts() {
- if (gpu_channel_manager_)
+ if (gpu_channel_manager_) {
gpu_channel_manager_->DestroyAllChannels();
+ media_service_->DestroyAllChannels();
+ }
}
void GpuChildThread::BindProcessControlRequest(
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698