Make IPC::Channel::Listener:OnMessageReceived have a return value indicating whether a message was processed or not.

TBR=brettw
Review URL: http://codereview.chromium.org/5978003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70139 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ppapi/proxy/dispatcher.cc b/ppapi/proxy/dispatcher.cc
index 9b7958c4..e6637db1 100644
--- a/ppapi/proxy/dispatcher.cc
+++ b/ppapi/proxy/dispatcher.cc
@@ -87,28 +87,32 @@
   return true;
 }
 
-void Dispatcher::OnMessageReceived(const IPC::Message& msg) {
+bool Dispatcher::OnMessageReceived(const IPC::Message& msg) {
   // Control messages.
   if (msg.routing_id() == MSG_ROUTING_CONTROL) {
+    bool handled = true;
     IPC_BEGIN_MESSAGE_MAP(Dispatcher, msg)
       IPC_MESSAGE_HANDLER(PpapiMsg_DeclareInterfaces,
                           OnMsgDeclareInterfaces)
       IPC_MESSAGE_HANDLER(PpapiMsg_SupportsInterface, OnMsgSupportsInterface)
       IPC_MESSAGE_FORWARD(PpapiMsg_ExecuteCallback, &callback_tracker_,
                           CallbackTracker::ReceiveExecuteSerializedCallback)
+      IPC_MESSAGE_UNHANDLED(handled = false)
     IPC_END_MESSAGE_MAP()
-    return;
+    return handled;
   }
 
   // Interface-specific messages.
   if (msg.routing_id() > 0 && msg.routing_id() < INTERFACE_ID_COUNT) {
     InterfaceProxy* proxy = id_to_proxy_[msg.routing_id()];
     if (proxy)
-      proxy->OnMessageReceived(msg);
-    else
-      NOTREACHED();
+      return proxy->OnMessageReceived(msg);
+
+    NOTREACHED();
     // TODO(brettw): kill the plugin if it starts sending invalid messages?
   }
+
+  return false;
 }
 
 void Dispatcher::SetSerializationRules(
diff --git a/ppapi/proxy/dispatcher.h b/ppapi/proxy/dispatcher.h
index 1c76cb8..2aec49cc 100644
--- a/ppapi/proxy/dispatcher.h
+++ b/ppapi/proxy/dispatcher.h
@@ -103,7 +103,7 @@
   virtual bool Send(IPC::Message* msg);
 
   // IPC::Channel::Listener implementation.
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
   IPC::SyncChannel* channel() const {
     return channel_.get();
diff --git a/ppapi/proxy/interface_proxy.h b/ppapi/proxy/interface_proxy.h
index 33e19bb..672e268 100644
--- a/ppapi/proxy/interface_proxy.h
+++ b/ppapi/proxy/interface_proxy.h
@@ -59,7 +59,7 @@
   virtual InterfaceID GetInterfaceId() const = 0;
 
   // Sub-classes must implement IPC::Channel::Listener which contains this:
-  //virtual void OnMessageReceived(const IPC::Message& msg);
+  //virtual bool OnMessageReceived(const IPC::Message& msg);
 
  protected:
   uint32 SendCallback(PP_CompletionCallback callback);
diff --git a/ppapi/proxy/plugin_dispatcher.cc b/ppapi/proxy/plugin_dispatcher.cc
index a6c97a0..ff7ccb7 100644
--- a/ppapi/proxy/plugin_dispatcher.cc
+++ b/ppapi/proxy/plugin_dispatcher.cc
@@ -70,21 +70,22 @@
   return true;
 }
 
-void PluginDispatcher::OnMessageReceived(const IPC::Message& msg) {
+bool PluginDispatcher::OnMessageReceived(const IPC::Message& msg) {
   if (msg.routing_id() == MSG_ROUTING_CONTROL) {
     // Handle some plugin-specific control messages.
+    bool handled = true;
     IPC_BEGIN_MESSAGE_MAP(PluginDispatcher, msg)
       IPC_MESSAGE_HANDLER(PpapiMsg_InitializeModule, OnMsgInitializeModule)
       IPC_MESSAGE_HANDLER(PpapiMsg_Shutdown, OnMsgShutdown)
 
       // Forward all other control messages to the superclass.
-      IPC_MESSAGE_UNHANDLED(Dispatcher::OnMessageReceived(msg))
+      IPC_MESSAGE_UNHANDLED(handled = Dispatcher::OnMessageReceived(msg))
     IPC_END_MESSAGE_MAP()
-    return;
+    return handled;
   }
 
   // All non-control messages get handled by the superclass.
-  Dispatcher::OnMessageReceived(msg);
+  return Dispatcher::OnMessageReceived(msg);
 }
 
 void PluginDispatcher::OnMsgInitializeModule(PP_Module pp_module,
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index 5b8ffb7..924b611 100644
--- a/ppapi/proxy/plugin_dispatcher.h
+++ b/ppapi/proxy/plugin_dispatcher.h
@@ -46,7 +46,7 @@
   virtual bool IsPlugin() const;
 
   // IPC::Channel::Listener implementation.
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
   // Returns the resource tracker for the plugin. In the browser process this
   // will return NULL.
diff --git a/ppapi/proxy/ppb_audio_config_proxy.cc b/ppapi/proxy/ppb_audio_config_proxy.cc
index 7ec3e8f7..40abd4f 100644
--- a/ppapi/proxy/ppb_audio_config_proxy.cc
+++ b/ppapi/proxy/ppb_audio_config_proxy.cc
@@ -107,13 +107,16 @@
   return INTERFACE_ID_PPB_AUDIO_CONFIG;
 }
 
-void PPB_AudioConfig_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_AudioConfig_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_AudioConfig_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudioConfig_Create,
                         OnMsgCreateStereo16Bit)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudioConfig_RecommendSampleFrameCount,
                         OnMsgRecommendSampleFrameCount)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
+  return handled;
 }
 
 void PPB_AudioConfig_Proxy::OnMsgCreateStereo16Bit(PP_Module module,
diff --git a/ppapi/proxy/ppb_audio_config_proxy.h b/ppapi/proxy/ppb_audio_config_proxy.h
index b80ea31..0236216 100644
--- a/ppapi/proxy/ppb_audio_config_proxy.h
+++ b/ppapi/proxy/ppb_audio_config_proxy.h
@@ -27,7 +27,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_audio_proxy.cc b/ppapi/proxy/ppb_audio_proxy.cc
index 84db37a..4468c4e 100644
--- a/ppapi/proxy/ppb_audio_proxy.cc
+++ b/ppapi/proxy/ppb_audio_proxy.cc
@@ -132,15 +132,17 @@
   return INTERFACE_ID_PPB_AUDIO;
 }
 
-void PPB_Audio_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Audio_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Audio_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_Create, OnMsgCreate)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_StartOrStop,
                         OnMsgStartOrStop)
-
     IPC_MESSAGE_HANDLER(PpapiMsg_PPBAudio_NotifyAudioStreamCreated,
                         OnMsgNotifyAudioStreamCreated)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
+  return handled;
 }
 
 void PPB_Audio_Proxy::OnMsgCreate(PP_Instance instance_id,
diff --git a/ppapi/proxy/ppb_audio_proxy.h b/ppapi/proxy/ppb_audio_proxy.h
index a6d2738..a8dc748 100644
--- a/ppapi/proxy/ppb_audio_proxy.h
+++ b/ppapi/proxy/ppb_audio_proxy.h
@@ -33,7 +33,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Plugin->renderer message handlers.
diff --git a/ppapi/proxy/ppb_buffer_proxy.cc b/ppapi/proxy/ppb_buffer_proxy.cc
index 4decffd..0015f5e 100644
--- a/ppapi/proxy/ppb_buffer_proxy.cc
+++ b/ppapi/proxy/ppb_buffer_proxy.cc
@@ -131,11 +131,14 @@
   return INTERFACE_ID_PPB_BUFFER;
 }
 
-void PPB_Buffer_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Buffer_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Buffer_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBBuffer_Create, OnMsgCreate)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw) handle bad messages!
+  return handled;
 }
 
 void PPB_Buffer_Proxy::OnMsgCreate(PP_Module module,
diff --git a/ppapi/proxy/ppb_buffer_proxy.h b/ppapi/proxy/ppb_buffer_proxy.h
index d273193..ccd6721 100644
--- a/ppapi/proxy/ppb_buffer_proxy.h
+++ b/ppapi/proxy/ppb_buffer_proxy.h
@@ -25,7 +25,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_char_set_proxy.cc b/ppapi/proxy/ppb_char_set_proxy.cc
index d5be4c5..ad65084 100644
--- a/ppapi/proxy/ppb_char_set_proxy.cc
+++ b/ppapi/proxy/ppb_char_set_proxy.cc
@@ -88,7 +88,8 @@
   return INTERFACE_ID_PPB_CHAR_SET;
 }
 
-void PPB_CharSet_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_CharSet_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_CharSet_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCharSet_UTF16ToCharSet,
                         OnMsgUTF16ToCharSet)
@@ -96,7 +97,9 @@
                         OnMsgCharSetToUTF16)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCharSet_GetDefaultCharSet,
                         OnMsgGetDefaultCharSet)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
+  return handled;
 }
 
 void PPB_CharSet_Proxy::OnMsgUTF16ToCharSet(const string16& utf16,
diff --git a/ppapi/proxy/ppb_char_set_proxy.h b/ppapi/proxy/ppb_char_set_proxy.h
index 17dddd5..d944373 100644
--- a/ppapi/proxy/ppb_char_set_proxy.h
+++ b/ppapi/proxy/ppb_char_set_proxy.h
@@ -30,7 +30,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_core_proxy.cc b/ppapi/proxy/ppb_core_proxy.cc
index 51d24d7..32cad67 100644
--- a/ppapi/proxy/ppb_core_proxy.cc
+++ b/ppapi/proxy/ppb_core_proxy.cc
@@ -96,14 +96,17 @@
   return INTERFACE_ID_PPB_CORE;
 }
 
-void PPB_Core_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Core_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Core_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_AddRefResource,
                         OnMsgAddRefResource)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCore_ReleaseResource,
                         OnMsgReleaseResource)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw) handle bad messages!
+  return handled;
 }
 
 void PPB_Core_Proxy::OnMsgAddRefResource(PP_Resource resource) {
diff --git a/ppapi/proxy/ppb_core_proxy.h b/ppapi/proxy/ppb_core_proxy.h
index 66f17d8a..ece12dc 100644
--- a/ppapi/proxy/ppb_core_proxy.h
+++ b/ppapi/proxy/ppb_core_proxy.h
@@ -27,7 +27,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_cursor_control_proxy.cc b/ppapi/proxy/ppb_cursor_control_proxy.cc
index 4c6eaaea..f576ae0 100644
--- a/ppapi/proxy/ppb_cursor_control_proxy.cc
+++ b/ppapi/proxy/ppb_cursor_control_proxy.cc
@@ -80,7 +80,8 @@
   return INTERFACE_ID_PPB_CURSORCONTROL;
 }
 
-void PPB_CursorControl_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_CursorControl_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_CursorControl_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_SetCursor,
                         OnMsgSetCursor)
@@ -92,8 +93,10 @@
                         OnMsgHasCursorLock)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBCursorControl_CanLockCursor,
                         OnMsgCanLockCursor)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw): handle bad messages!
+  return handled;
 }
 
 void PPB_CursorControl_Proxy::OnMsgSetCursor(PP_Instance instance,
diff --git a/ppapi/proxy/ppb_cursor_control_proxy.h b/ppapi/proxy/ppb_cursor_control_proxy.h
index f540c0a..033e6c10d 100644
--- a/ppapi/proxy/ppb_cursor_control_proxy.h
+++ b/ppapi/proxy/ppb_cursor_control_proxy.h
@@ -29,7 +29,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index 5614e6a46..13fe1d0 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -224,7 +224,8 @@
   return INTERFACE_ID_PPB_FLASH;
 }
 
-void PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop,
                         OnMsgSetInstanceAlwaysOnTop)
@@ -245,8 +246,10 @@
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetModuleLocalDirContents,
                         OnMsgGetModuleLocalDirContents)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_NavigateToURL, OnMsgNavigateToURL)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw) handle bad messages!
+  return handled;
 }
 
 void PPB_Flash_Proxy::OnMsgSetInstanceAlwaysOnTop(
diff --git a/ppapi/proxy/ppb_flash_proxy.h b/ppapi/proxy/ppb_flash_proxy.h
index 8961a47..629761f 100644
--- a/ppapi/proxy/ppb_flash_proxy.h
+++ b/ppapi/proxy/ppb_flash_proxy.h
@@ -35,7 +35,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_font_proxy.cc b/ppapi/proxy/ppb_font_proxy.cc
index 9a4dbf56..1c72622 100644
--- a/ppapi/proxy/ppb_font_proxy.cc
+++ b/ppapi/proxy/ppb_font_proxy.cc
@@ -187,7 +187,8 @@
   return INTERFACE_ID_PPB_FONT;
 }
 
-void PPB_Font_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Font_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Font_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_Create,
                         OnMsgCreate)
@@ -199,7 +200,9 @@
                         OnMsgCharacterOffsetForPixel)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFont_PixelOffsetForCharacter,
                         OnMsgPixelOffsetForCharacter)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
+  return handled;
 }
 
 void PPB_Font_Proxy::OnMsgCreate(
diff --git a/ppapi/proxy/ppb_font_proxy.h b/ppapi/proxy/ppb_font_proxy.h
index 25e14ed7..4e68d70 100644
--- a/ppapi/proxy/ppb_font_proxy.h
+++ b/ppapi/proxy/ppb_font_proxy.h
@@ -31,7 +31,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_fullscreen_proxy.cc b/ppapi/proxy/ppb_fullscreen_proxy.cc
index ddf0cdb..ab537ea 100644
--- a/ppapi/proxy/ppb_fullscreen_proxy.cc
+++ b/ppapi/proxy/ppb_fullscreen_proxy.cc
@@ -50,14 +50,17 @@
   return INTERFACE_ID_PPB_FULLSCREEN;
 }
 
-void PPB_Fullscreen_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Fullscreen_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Fullscreen_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFullscreen_IsFullscreen,
                         OnMsgIsFullscreen)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFullscreen_SetFullscreen,
                         OnMsgSetFullscreen)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw): handle bad messages!
+  return handled;
 }
 
 void PPB_Fullscreen_Proxy::OnMsgIsFullscreen(PP_Instance instance,
diff --git a/ppapi/proxy/ppb_fullscreen_proxy.h b/ppapi/proxy/ppb_fullscreen_proxy.h
index f24eb7e..502d5b1 100644
--- a/ppapi/proxy/ppb_fullscreen_proxy.h
+++ b/ppapi/proxy/ppb_fullscreen_proxy.h
@@ -27,7 +27,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_graphics_2d_proxy.cc b/ppapi/proxy/ppb_graphics_2d_proxy.cc
index 74f8b91..06d5d0a6 100644
--- a/ppapi/proxy/ppb_graphics_2d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_2d_proxy.cc
@@ -166,7 +166,8 @@
   return INTERFACE_ID_PPB_GRAPHICS_2D;
 }
 
-void PPB_Graphics2D_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Graphics2D_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Graphics2D_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics2D_Create,
                         OnMsgCreate)
@@ -181,8 +182,10 @@
 
     IPC_MESSAGE_HANDLER(PpapiMsg_PPBGraphics2D_FlushACK,
                         OnMsgFlushACK)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // FIXME(brettw) handle bad messages!
+  return handled;
 }
 
 void PPB_Graphics2D_Proxy::OnMsgCreate(PP_Module module,
diff --git a/ppapi/proxy/ppb_graphics_2d_proxy.h b/ppapi/proxy/ppb_graphics_2d_proxy.h
index 66226b9..96d3277 100644
--- a/ppapi/proxy/ppb_graphics_2d_proxy.h
+++ b/ppapi/proxy/ppb_graphics_2d_proxy.h
@@ -35,7 +35,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Plugin->renderer message handlers.
diff --git a/ppapi/proxy/ppb_image_data_proxy.cc b/ppapi/proxy/ppb_image_data_proxy.cc
index 4fa4205..14b0479 100644
--- a/ppapi/proxy/ppb_image_data_proxy.cc
+++ b/ppapi/proxy/ppb_image_data_proxy.cc
@@ -119,15 +119,18 @@
   return INTERFACE_ID_PPB_IMAGE_DATA;
 }
 
-void PPB_ImageData_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_ImageData_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_ImageData_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBImageData_GetNativeImageDataFormat,
                         OnMsgGetNativeImageDataFormat)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBImageData_IsImageDataFormatSupported,
                         OnMsgIsImageDataFormatSupported)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBImageData_Create, OnMsgCreate)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // FIXME(brettw) handle bad messages!
+  return handled;
 }
 
 void PPB_ImageData_Proxy::OnMsgGetNativeImageDataFormat(int32* result) {
diff --git a/ppapi/proxy/ppb_image_data_proxy.h b/ppapi/proxy/ppb_image_data_proxy.h
index 5ff617ca..beec054 100644
--- a/ppapi/proxy/ppb_image_data_proxy.h
+++ b/ppapi/proxy/ppb_image_data_proxy.h
@@ -32,7 +32,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 1703b749..b26a028 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -84,7 +84,8 @@
   return INTERFACE_ID_PPB_INSTANCE;
 }
 
-void PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Instance_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetWindowObject,
                         OnMsgGetWindowObject)
@@ -96,7 +97,9 @@
                         OnMsgIsFullFrame)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ExecuteScript,
                         OnMsgExecuteScript)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
+  return handled;
 }
 
 void PPB_Instance_Proxy::OnMsgGetWindowObject(
diff --git a/ppapi/proxy/ppb_instance_proxy.h b/ppapi/proxy/ppb_instance_proxy.h
index 578f38b..b01e9b0 100644
--- a/ppapi/proxy/ppb_instance_proxy.h
+++ b/ppapi/proxy/ppb_instance_proxy.h
@@ -31,7 +31,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_pdf_proxy.cc b/ppapi/proxy/ppb_pdf_proxy.cc
index 0ba638e..cbd1f31 100644
--- a/ppapi/proxy/ppb_pdf_proxy.cc
+++ b/ppapi/proxy/ppb_pdf_proxy.cc
@@ -125,14 +125,17 @@
   return INTERFACE_ID_PPB_PDF;
 }
 
-void PPB_PDF_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_PDF_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_PDF_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBPDF_GetFontFileWithFallback,
                         OnMsgGetFontFileWithFallback)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBPDF_GetFontTableForPrivateFontFile,
                         OnMsgGetFontTableForPrivateFontFile)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw): handle bad messages!
+  return handled;
 }
 
 void PPB_PDF_Proxy::OnMsgGetFontFileWithFallback(
diff --git a/ppapi/proxy/ppb_pdf_proxy.h b/ppapi/proxy/ppb_pdf_proxy.h
index f229df2..071a493 100644
--- a/ppapi/proxy/ppb_pdf_proxy.h
+++ b/ppapi/proxy/ppb_pdf_proxy.h
@@ -27,7 +27,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_testing_proxy.cc b/ppapi/proxy/ppb_testing_proxy.cc
index d4ab8cc2..946cecb 100644
--- a/ppapi/proxy/ppb_testing_proxy.cc
+++ b/ppapi/proxy/ppb_testing_proxy.cc
@@ -66,7 +66,8 @@
   return INTERFACE_ID_PPB_TESTING;
 }
 
-void PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Testing_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Testing_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_ReadImageData,
                         OnMsgReadImageData)
@@ -76,7 +77,9 @@
                         OnMsgQuitMessageLoop)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTesting_GetLiveObjectCount,
                         OnMsgGetLiveObjectCount)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
+  return handled;
 }
 
 void PPB_Testing_Proxy::OnMsgReadImageData(PP_Resource device_context_2d,
diff --git a/ppapi/proxy/ppb_testing_proxy.h b/ppapi/proxy/ppb_testing_proxy.h
index 547f8abf..23314a8 100644
--- a/ppapi/proxy/ppb_testing_proxy.h
+++ b/ppapi/proxy/ppb_testing_proxy.h
@@ -28,7 +28,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_url_loader_proxy.cc b/ppapi/proxy/ppb_url_loader_proxy.cc
index 0d5bbb2..e60afd1c 100644
--- a/ppapi/proxy/ppb_url_loader_proxy.cc
+++ b/ppapi/proxy/ppb_url_loader_proxy.cc
@@ -248,7 +248,8 @@
   return INTERFACE_ID_PPB_URL_LOADER;
 }
 
-void PPB_URLLoader_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_URLLoader_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_URLLoader_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLLoader_Create,
                         OnMsgCreate)
@@ -269,8 +270,10 @@
                         OnMsgUpdateProgress)
     IPC_MESSAGE_HANDLER(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack,
                         OnMsgReadResponseBodyAck)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw) handle bad messages!
+  return handled;
 }
 
 void PPB_URLLoader_Proxy::OnMsgCreate(PP_Instance instance,
@@ -427,12 +430,15 @@
   return INTERFACE_ID_PPB_URL_LOADER_TRUSTED;
 }
 
-void PPB_URLLoaderTrusted_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_URLLoaderTrusted_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_URLLoaderTrusted_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLLoaderTrusted_GrantUniversalAccess,
                         OnMsgGrantUniversalAccess)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP();
   // TODO(brettw) handle bad messages!
+  return handled;
 }
 
 void PPB_URLLoaderTrusted_Proxy::OnMsgGrantUniversalAccess(PP_Resource loader) {
diff --git a/ppapi/proxy/ppb_url_loader_proxy.h b/ppapi/proxy/ppb_url_loader_proxy.h
index ca9a83d..3755d46 100644
--- a/ppapi/proxy/ppb_url_loader_proxy.h
+++ b/ppapi/proxy/ppb_url_loader_proxy.h
@@ -39,7 +39,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Data associated with callbacks for ReadResponseBody.
@@ -92,7 +92,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Plugin->renderer message handlers.
diff --git a/ppapi/proxy/ppb_url_request_info_proxy.cc b/ppapi/proxy/ppb_url_request_info_proxy.cc
index 6a91286..02bd3e6 100644
--- a/ppapi/proxy/ppb_url_request_info_proxy.cc
+++ b/ppapi/proxy/ppb_url_request_info_proxy.cc
@@ -111,7 +111,8 @@
   return INTERFACE_ID_PPB_URL_REQUEST_INFO;
 }
 
-void PPB_URLRequestInfo_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_URLRequestInfo_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_URLRequestInfo_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_Create, OnMsgCreate)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_SetProperty,
@@ -120,8 +121,10 @@
                         OnMsgAppendDataToBody)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody,
                         OnMsgAppendFileToBody)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw): handle bad messages.
+  return handled;
 }
 
 void PPB_URLRequestInfo_Proxy::OnMsgCreate(
diff --git a/ppapi/proxy/ppb_url_request_info_proxy.h b/ppapi/proxy/ppb_url_request_info_proxy.h
index b620f4a..47e2e27 100644
--- a/ppapi/proxy/ppb_url_request_info_proxy.h
+++ b/ppapi/proxy/ppb_url_request_info_proxy.h
@@ -30,7 +30,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_url_response_info_proxy.cc b/ppapi/proxy/ppb_url_response_info_proxy.cc
index c85150e..01e1763 100644
--- a/ppapi/proxy/ppb_url_response_info_proxy.cc
+++ b/ppapi/proxy/ppb_url_response_info_proxy.cc
@@ -85,14 +85,17 @@
   return INTERFACE_ID_PPB_URL_RESPONSE_INFO;
 }
 
-void PPB_URLResponseInfo_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_URLResponseInfo_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_URLResponseInfo_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetProperty,
                         OnMsgGetProperty)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef,
                         OnMsgGetBodyAsFileRef)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw): handle bad messages.
+  return handled;
 }
 
 void PPB_URLResponseInfo_Proxy::OnMsgGetProperty(
diff --git a/ppapi/proxy/ppb_url_response_info_proxy.h b/ppapi/proxy/ppb_url_response_info_proxy.h
index 423ca3e..c1de2594 100644
--- a/ppapi/proxy/ppb_url_response_info_proxy.h
+++ b/ppapi/proxy/ppb_url_response_info_proxy.h
@@ -35,7 +35,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppb_var_deprecated_proxy.cc b/ppapi/proxy/ppb_var_deprecated_proxy.cc
index 42abbc7..f37b0e3 100644
--- a/ppapi/proxy/ppb_var_deprecated_proxy.cc
+++ b/ppapi/proxy/ppb_var_deprecated_proxy.cc
@@ -247,7 +247,8 @@
   return INTERFACE_ID_PPB_VAR_DEPRECATED;
 }
 
-void PPB_Var_Deprecated_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPB_Var_Deprecated_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPB_Var_Deprecated_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_HasProperty,
                         OnMsgHasProperty)
@@ -269,8 +270,10 @@
                         OnMsgIsInstanceOfDeprecated)
     IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBVar_CreateObjectDeprecated,
                         OnMsgCreateObjectDeprecated)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   // TODO(brettw) handle bad messages!
+  return handled;
 }
 
 void PPB_Var_Deprecated_Proxy::OnMsgHasProperty(
diff --git a/ppapi/proxy/ppb_var_deprecated_proxy.h b/ppapi/proxy/ppb_var_deprecated_proxy.h
index 41484471..c712460 100644
--- a/ppapi/proxy/ppb_var_deprecated_proxy.h
+++ b/ppapi/proxy/ppb_var_deprecated_proxy.h
@@ -37,7 +37,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.
diff --git a/ppapi/proxy/ppp_class_proxy.cc b/ppapi/proxy/ppp_class_proxy.cc
index b2fad17..ab71565fc 100644
--- a/ppapi/proxy/ppp_class_proxy.cc
+++ b/ppapi/proxy/ppp_class_proxy.cc
@@ -200,7 +200,8 @@
   return INTERFACE_ID_PPP_CLASS;
 }
 
-void PPP_Class_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPP_Class_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPP_Class_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiMsg_PPPClass_HasProperty,
                         OnMsgHasProperty)
@@ -218,7 +219,9 @@
                         OnMsgConstruct)
     IPC_MESSAGE_HANDLER(PpapiMsg_PPPClass_Deallocate,
                         OnMsgDeallocate)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
+  return handled;
 }
 
 void PPP_Class_Proxy::OnMsgHasProperty(int64 ppp_class, int64 object,
diff --git a/ppapi/proxy/ppp_class_proxy.h b/ppapi/proxy/ppp_class_proxy.h
index b22d86a04..d4e2102b 100644
--- a/ppapi/proxy/ppp_class_proxy.h
+++ b/ppapi/proxy/ppp_class_proxy.h
@@ -42,7 +42,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // IPC message handlers.
diff --git a/ppapi/proxy/ppp_instance_proxy.cc b/ppapi/proxy/ppp_instance_proxy.cc
index 8551d2b..886b7f1 100644
--- a/ppapi/proxy/ppp_instance_proxy.cc
+++ b/ppapi/proxy/ppp_instance_proxy.cc
@@ -109,7 +109,8 @@
   return INTERFACE_ID_PPP_INSTANCE;
 }
 
-void PPP_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
+bool PPP_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
+  bool handled = true;
   IPC_BEGIN_MESSAGE_MAP(PPP_Instance_Proxy, msg)
     IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidCreate,
                         OnMsgDidCreate)
@@ -125,7 +126,9 @@
                         OnMsgHandleDocumentLoad)
     IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_GetInstanceObject,
                         OnMsgGetInstanceObject)
+    IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
+  return handled;
 }
 
 void PPP_Instance_Proxy::OnMsgDidCreate(
diff --git a/ppapi/proxy/ppp_instance_proxy.h b/ppapi/proxy/ppp_instance_proxy.h
index 9df247b..5d02fc8 100644
--- a/ppapi/proxy/ppp_instance_proxy.h
+++ b/ppapi/proxy/ppp_instance_proxy.h
@@ -34,7 +34,7 @@
   // InterfaceProxy implementation.
   virtual const void* GetSourceInterface() const;
   virtual InterfaceID GetInterfaceId() const;
-  virtual void OnMessageReceived(const IPC::Message& msg);
+  virtual bool OnMessageReceived(const IPC::Message& msg);
 
  private:
   // Message handlers.