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; |