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

Unified Diff: content/common/gpu/gpu_channel.cc

Issue 1767673002: Revert of Decouple Media Service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index bb53c4b8721d83262c5ec730791b44205bfb2227..a50c62bd7ac29dcbad5ae253819670c18377f918 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -34,6 +34,7 @@
#include "content/common/gpu/gpu_channel_manager_delegate.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "content/common/gpu/gpu_messages.h"
+#include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/value_state.h"
@@ -71,6 +72,21 @@
// Stop the preemption once the time for the longest pending IPC drops
// below this threshold.
const int64_t kStopPreemptThresholdMs = kVsyncIntervalMs;
+
+void SendCreateJpegDecoderResult(
+ scoped_ptr<IPC::Message> reply_message,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
+ base::WeakPtr<GpuChannel> channel,
+ scoped_refptr<GpuChannelMessageFilter> filter,
+ bool result) {
+ GpuChannelMsg_CreateJpegDecoder::WriteReplyParams(reply_message.get(),
+ result);
+ if (io_task_runner->BelongsToCurrentThread()) {
+ filter->Send(reply_message.release());
+ } else {
+ channel->Send(reply_message.release());
+ }
+}
} // anonymous namespace
@@ -589,7 +605,6 @@
bool allow_real_time_streams)
: gpu_channel_manager_(gpu_channel_manager),
sync_point_manager_(sync_point_manager),
- unhandled_message_listener_(nullptr),
channel_id_(IPC::Channel::GenerateVerifiedChannelID("gpu")),
preempting_flag_(preempting_flag),
preempted_flag_(preempted_flag),
@@ -652,14 +667,6 @@
return channel_handle;
}
-void GpuChannel::SetUnhandledMessageListener(IPC::Listener* listener) {
- unhandled_message_listener_ = listener;
-}
-
-base::WeakPtr<GpuChannel> GpuChannel::AsWeakPtr() {
- return weak_factory_.GetWeakPtr();
-}
-
base::ProcessId GpuChannel::GetClientPID() const {
return channel_->GetPeerPID();
}
@@ -759,8 +766,11 @@
OnCreateOffscreenCommandBuffer)
IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer,
OnDestroyCommandBuffer)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuChannelMsg_CreateJpegDecoder,
+ OnCreateJpegDecoder)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled) << msg.type();
return handled;
}
@@ -821,9 +831,6 @@
} else {
handled = router_.RouteMessage(msg);
}
-
- if (!handled && unhandled_message_listener_)
- handled = unhandled_message_listener_->OnMessageReceived(msg);
// Respond to sync messages even if router failed to route.
if (!handled && msg.is_sync()) {
@@ -990,6 +997,18 @@
}
RemoveRoute(route_id);
+}
+
+void GpuChannel::OnCreateJpegDecoder(int32_t route_id,
+ IPC::Message* reply_msg) {
+ scoped_ptr<IPC::Message> msg(reply_msg);
+ if (!jpeg_decoder_) {
+ jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_));
+ }
+ jpeg_decoder_->AddClient(
+ route_id,
+ base::Bind(&SendCreateJpegDecoderResult, base::Passed(&msg),
+ io_task_runner_, weak_factory_.GetWeakPtr(), filter_));
}
void GpuChannel::CacheShader(const std::string& key,
« no previous file with comments | « content/common/gpu/gpu_channel.h ('k') | content/common/gpu/gpu_channel_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698