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

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

Issue 23125014: Run VDA::Decode on GPU IO thread if VDA supports it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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: content/common/gpu/gpu_channel.cc
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 2b920d3a0704dfeffefb4c62887227867abed977..0cdc5816643bad4cb65b804c5583b1e6c1ad85d8 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -104,6 +104,14 @@ class GpuChannelMessageFilter : public IPC::ChannelProxy::MessageFilter {
channel_ = NULL;
}
+ void AddRoute(int32 route_id, IPC::Listener* listener) {
+ router_.AddRoute(route_id, listener);
+ }
+
+ void RemoveRoute(int32 route_id) {
+ router_.RemoveRoute(route_id);
+ }
+
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
DCHECK(channel_);
@@ -122,6 +130,10 @@ class GpuChannelMessageFilter : public IPC::ChannelProxy::MessageFilter {
handled = true;
}
+ if (message.type() == AcceleratedVideoDecoderMsg_Decode::ID) {
+ handled = router_.RouteMessage(message);
+ }
+
// All other messages get processed by the GpuChannel.
if (!handled) {
messages_forwarded_to_channel_++;
@@ -428,6 +440,9 @@ class GpuChannelMessageFilter : public IPC::ChannelProxy::MessageFilter {
bool a_stub_is_descheduled_;
crypto::HMAC hmac_;
+
+ // Used to implement message routing functionality running on IO thread.
+ MessageRouter router_;
};
GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
@@ -720,6 +735,15 @@ void GpuChannel::RemoveRoute(int32 route_id) {
router_.RemoveRoute(route_id);
}
+void GpuChannel::AddMessageFilterRoute(int32 route_id,
+ IPC::Listener* listener) {
+ filter_->AddRoute(route_id, listener);
+}
+
+void GpuChannel::RemoveMessageFilterRoute(int32 route_id) {
+ filter_->RemoveRoute(route_id);
+}
+
gpu::PreemptionFlag* GpuChannel::GetPreemptionFlag() {
if (!preempting_flag_.get()) {
preempting_flag_ = new gpu::PreemptionFlag;

Powered by Google App Engine
This is Rietveld 408576698