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

Unified Diff: chrome/gpu/gpu_channel.cc

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | « chrome/gpu/gpu_channel.h ('k') | chrome/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/gpu_channel.cc
===================================================================
--- chrome/gpu/gpu_channel.cc (revision 70108)
+++ chrome/gpu/gpu_channel.cc (working copy)
@@ -38,19 +38,18 @@
}
}
-void GpuChannel::OnMessageReceived(const IPC::Message& message) {
+bool GpuChannel::OnMessageReceived(const IPC::Message& message) {
if (log_messages_) {
VLOG(1) << "received message @" << &message << " on channel @" << this
<< " with type " << message.type();
}
- if (message.routing_id() == MSG_ROUTING_CONTROL) {
- OnControlMessageReceived(message);
- } else {
- // Fail silently if the GPU process has destroyed while the IPC message was
- // en-route.
- router_.RouteMessage(message);
- }
+ if (message.routing_id() == MSG_ROUTING_CONTROL)
+ return OnControlMessageReceived(message);
+
+ // Fail silently if the GPU process has destroyed while the IPC message was
+ // en-route.
+ return router_.RouteMessage(message);
}
void GpuChannel::OnChannelError() {
@@ -94,7 +93,8 @@
}
#endif
-void GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
+bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg)
IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateViewCommandBuffer,
OnCreateViewCommandBuffer)
@@ -106,8 +106,10 @@
OnCreateVideoDecoder)
IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyVideoDecoder,
OnDestroyVideoDecoder)
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
int GpuChannel::GenerateRouteID() {
« no previous file with comments | « chrome/gpu/gpu_channel.h ('k') | chrome/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698