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

Unified Diff: chrome/plugin/plugin_channel_base.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/plugin/plugin_channel_base.h ('k') | chrome/plugin/plugin_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/plugin_channel_base.cc
===================================================================
--- chrome/plugin/plugin_channel_base.cc (revision 70108)
+++ chrome/plugin/plugin_channel_base.cc (working copy)
@@ -140,19 +140,20 @@
return static_cast<int>(g_plugin_channels_.size());
}
-void PluginChannelBase::OnMessageReceived(const IPC::Message& message) {
+bool PluginChannelBase::OnMessageReceived(const IPC::Message& message) {
// This call might cause us to be deleted, so keep an extra reference to
// ourself so that we can send the reply and decrement back in_dispatch_.
lazy_plugin_channel_stack_.Pointer()->push(
scoped_refptr<PluginChannelBase>(this));
+ bool handled;
if (message.should_unblock())
in_unblock_dispatch_++;
if (message.routing_id() == MSG_ROUTING_CONTROL) {
- OnControlMessageReceived(message);
+ handled = OnControlMessageReceived(message);
} else {
- bool routed = router_.RouteMessage(message);
- if (!routed && message.is_sync()) {
+ handled = router_.RouteMessage(message);
+ if (!handled && message.is_sync()) {
// The listener has gone away, so we must respond or else the caller will
// hang waiting for a reply.
IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message);
@@ -164,6 +165,7 @@
in_unblock_dispatch_--;
lazy_plugin_channel_stack_.Pointer()->pop();
+ return handled;
}
void PluginChannelBase::OnChannelConnected(int32 peer_pid) {
@@ -228,9 +230,10 @@
}
}
-void PluginChannelBase::OnControlMessageReceived(const IPC::Message& msg) {
+bool PluginChannelBase::OnControlMessageReceived(const IPC::Message& msg) {
NOTREACHED() <<
"should override in subclass if you care about control messages";
+ return false;
}
void PluginChannelBase::OnChannelError() {
« no previous file with comments | « chrome/plugin/plugin_channel_base.h ('k') | chrome/plugin/plugin_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698