summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/appcache/appcache_dispatcher_host.cc21
-rw-r--r--chrome/browser/automation/automation_provider.cc8
-rw-r--r--chrome/browser/automation/automation_provider.h2
-rw-r--r--chrome/browser/automation/chrome_frame_automation_provider.cc12
-rw-r--r--chrome/browser/automation/chrome_frame_automation_provider.h2
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc7
-rw-r--r--chrome/browser/automation/testing_automation_provider.h2
-rw-r--r--chrome/browser/gpu_process_host.cc13
-rw-r--r--chrome/browser/gpu_process_host.h4
-rw-r--r--chrome/browser/gpu_process_host_ui_shim.cc16
-rw-r--r--chrome/browser/gpu_process_host_ui_shim.h4
-rw-r--r--chrome/browser/importer/firefox_importer_unittest_utils_mac.cc10
-rw-r--r--chrome/browser/nacl_host/nacl_broker_host_win.cc5
-rw-r--r--chrome/browser/nacl_host/nacl_broker_host_win.h2
-rw-r--r--chrome/browser/nacl_host/nacl_process_host.cc3
-rw-r--r--chrome/browser/nacl_host/nacl_process_host.h2
-rw-r--r--chrome/browser/plugin_data_remover.cc4
-rw-r--r--chrome/browser/plugin_data_remover.h4
-rw-r--r--chrome/browser/plugin_process_host.cc8
-rw-r--r--chrome/browser/plugin_process_host.h2
-rw-r--r--chrome/browser/ppapi_plugin_process_host.cc7
-rw-r--r--chrome/browser/ppapi_plugin_process_host.h2
-rw-r--r--chrome/browser/profile_import_process_host.cc8
-rw-r--r--chrome/browser/profile_import_process_host.h4
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc10
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.h2
-rw-r--r--chrome/browser/renderer_host/mock_render_process_host.cc3
-rw-r--r--chrome/browser/renderer_host/mock_render_process_host.h2
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc9
-rw-r--r--chrome/browser/renderer_host/render_view_host.h2
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc6
-rw-r--r--chrome/browser/renderer_host/render_widget_host.h2
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.cc4
-rw-r--r--chrome/browser/renderer_host/test/test_render_view_host.h2
-rw-r--r--chrome/browser/service/service_process_control.cc15
-rw-r--r--chrome/browser/service/service_process_control.h2
-rw-r--r--chrome/browser/utility_process_host.cc8
-rw-r--r--chrome/browser/utility_process_host.h4
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc7
-rw-r--r--chrome/browser/worker_host/worker_process_host.h2
-rw-r--r--chrome/common/appcache/appcache_dispatcher.h5
-rw-r--r--chrome/common/child_process_host.cc7
-rw-r--r--chrome/common/child_process_host.h4
-rw-r--r--chrome/common/child_thread.cc19
-rw-r--r--chrome/common/child_thread.h6
-rw-r--r--chrome/common/file_system/file_system_dispatcher.h3
-rw-r--r--chrome/common/message_router.cc14
-rw-r--r--chrome/common/message_router.h4
-rw-r--r--chrome/common/resource_dispatcher.h5
-rw-r--r--chrome/common/socket_stream_dispatcher.h9
-rw-r--r--chrome/common/webmessageportchannel_impl.cc5
-rw-r--r--chrome/common/webmessageportchannel_impl.h2
-rw-r--r--chrome/gpu/gpu_channel.cc22
-rw-r--r--chrome/gpu/gpu_channel.h4
-rw-r--r--chrome/gpu/gpu_command_buffer_stub.cc7
-rw-r--r--chrome/gpu/gpu_command_buffer_stub.h2
-rw-r--r--chrome/gpu/gpu_thread.cc5
-rw-r--r--chrome/gpu/gpu_thread.h2
-rw-r--r--chrome/gpu/gpu_video_decoder.cc7
-rw-r--r--chrome/gpu/gpu_video_decoder.h2
-rw-r--r--chrome/gpu/gpu_video_service.cc3
-rw-r--r--chrome/gpu/gpu_video_service.h2
-rw-r--r--chrome/nacl/broker_thread.cc5
-rw-r--r--chrome/nacl/broker_thread.h2
-rw-r--r--chrome/nacl/nacl_thread.cc5
-rw-r--r--chrome/nacl/nacl_thread.h2
-rw-r--r--chrome/plugin/command_buffer_stub.cc7
-rw-r--r--chrome/plugin/command_buffer_stub.h2
-rw-r--r--chrome/plugin/npobject_proxy.cc3
-rw-r--r--chrome/plugin/npobject_proxy.h2
-rw-r--r--chrome/plugin/npobject_stub.cc9
-rw-r--r--chrome/plugin/npobject_stub.h2
-rw-r--r--chrome/plugin/plugin_channel.cc11
-rw-r--r--chrome/plugin/plugin_channel.h4
-rw-r--r--chrome/plugin/plugin_channel_base.cc13
-rw-r--r--chrome/plugin/plugin_channel_base.h4
-rw-r--r--chrome/plugin/plugin_thread.cc5
-rw-r--r--chrome/plugin/plugin_thread.h2
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc8
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h2
-rw-r--r--chrome/ppapi_plugin/ppapi_thread.cc3
-rw-r--r--chrome/ppapi_plugin/ppapi_thread.h2
-rw-r--r--chrome/profile_import/profile_import_thread.cc5
-rw-r--r--chrome/profile_import/profile_import_thread.h2
-rw-r--r--chrome/renderer/command_buffer_proxy.cc7
-rw-r--r--chrome/renderer/command_buffer_proxy.h2
-rw-r--r--chrome/renderer/device_orientation_dispatcher.h6
-rw-r--r--chrome/renderer/devtools_agent.h10
-rw-r--r--chrome/renderer/devtools_client.h10
-rw-r--r--chrome/renderer/geolocation_dispatcher_old.h8
-rw-r--r--chrome/renderer/gpu_channel_host.cc4
-rw-r--r--chrome/renderer/gpu_channel_host.h2
-rw-r--r--chrome/renderer/gpu_video_decoder_host.cc7
-rw-r--r--chrome/renderer/gpu_video_decoder_host.h2
-rw-r--r--chrome/renderer/indexed_db_dispatcher.h7
-rw-r--r--chrome/renderer/mock_render_thread.cc3
-rw-r--r--chrome/renderer/mock_render_thread.h2
-rw-r--r--chrome/renderer/notification_provider.h5
-rw-r--r--chrome/renderer/plugin_channel_host.cc7
-rw-r--r--chrome/renderer/plugin_channel_host.h2
-rw-r--r--chrome/renderer/render_thread.cc9
-rw-r--r--chrome/renderer/render_thread.h2
-rw-r--r--chrome/renderer/render_view.cc18
-rw-r--r--chrome/renderer/render_view.h2
-rw-r--r--chrome/renderer/render_widget.cc42
-rw-r--r--chrome/renderer/render_widget.h2
-rw-r--r--chrome/renderer/renderer_main_unittest.cc5
-rw-r--r--chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc6
-rw-r--r--chrome/renderer/safe_browsing/render_view_fake_resources_test.cc3
-rw-r--r--chrome/renderer/safe_browsing/render_view_fake_resources_test.h2
-rw-r--r--chrome/renderer/speech_input_dispatcher.h8
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc8
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h2
-rw-r--r--chrome/renderer/websharedworker_proxy.cc5
-rw-r--r--chrome/renderer/websharedworker_proxy.h2
-rw-r--r--chrome/renderer/webworker_proxy.cc7
-rw-r--r--chrome/renderer/webworker_proxy.h2
-rw-r--r--chrome/service/service_ipc_server.cc5
-rw-r--r--chrome/service/service_ipc_server.h2
-rw-r--r--chrome/service/service_utility_process_host.cc8
-rw-r--r--chrome/service/service_utility_process_host.h4
-rw-r--r--chrome/test/automation/automation_proxy.cc14
-rw-r--r--chrome/test/automation/automation_proxy.h2
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc5
-rw-r--r--chrome/test/automation/automation_proxy_uitest.h2
-rw-r--r--chrome/test/automation/tab_proxy.cc3
-rw-r--r--chrome/test/automation/tab_proxy.h2
-rw-r--r--chrome/utility/utility_thread.cc5
-rw-r--r--chrome/utility/utility_thread.h2
-rw-r--r--chrome/worker/websharedworker_stub.cc5
-rw-r--r--chrome/worker/websharedworker_stub.h2
-rw-r--r--chrome/worker/webworker_stub.cc7
-rw-r--r--chrome/worker/webworker_stub.h2
-rw-r--r--chrome/worker/worker_thread.cc7
-rw-r--r--chrome/worker/worker_thread.h2
135 files changed, 452 insertions, 307 deletions
diff --git a/chrome/browser/appcache/appcache_dispatcher_host.cc b/chrome/browser/appcache/appcache_dispatcher_host.cc
index 60172ea..8bcf53e 100644
--- a/chrome/browser/appcache/appcache_dispatcher_host.cc
+++ b/chrome/browser/appcache/appcache_dispatcher_host.cc
@@ -60,20 +60,19 @@ void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) {
bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& message,
bool* message_was_ok) {
bool handled = true;
-
IPC_BEGIN_MESSAGE_MAP_EX(AppCacheDispatcherHost, message, *message_was_ok)
- IPC_MESSAGE_HANDLER(AppCacheMsg_RegisterHost, OnRegisterHost);
- IPC_MESSAGE_HANDLER(AppCacheMsg_UnregisterHost, OnUnregisterHost);
- IPC_MESSAGE_HANDLER(AppCacheMsg_GetResourceList, OnGetResourceList);
- IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCache, OnSelectCache);
+ IPC_MESSAGE_HANDLER(AppCacheMsg_RegisterHost, OnRegisterHost)
+ IPC_MESSAGE_HANDLER(AppCacheMsg_UnregisterHost, OnUnregisterHost)
+ IPC_MESSAGE_HANDLER(AppCacheMsg_GetResourceList, OnGetResourceList)
+ IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCache, OnSelectCache)
IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCacheForWorker,
- OnSelectCacheForWorker);
+ OnSelectCacheForWorker)
IPC_MESSAGE_HANDLER(AppCacheMsg_SelectCacheForSharedWorker,
- OnSelectCacheForSharedWorker);
- IPC_MESSAGE_HANDLER(AppCacheMsg_MarkAsForeignEntry, OnMarkAsForeignEntry);
- IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_GetStatus, OnGetStatus);
- IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_StartUpdate, OnStartUpdate);
- IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_SwapCache, OnSwapCache);
+ OnSelectCacheForSharedWorker)
+ IPC_MESSAGE_HANDLER(AppCacheMsg_MarkAsForeignEntry, OnMarkAsForeignEntry)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_GetStatus, OnGetStatus)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_StartUpdate, OnStartUpdate)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(AppCacheMsg_SwapCache, OnSwapCache)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index e4e1909..b782c2c 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -358,14 +358,15 @@ void AutomationProvider::OnChannelConnected(int pid) {
Send(new AutomationMsg_InitialLoadsComplete());
}
-void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
+bool AutomationProvider::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AutomationProvider, message)
#if !defined(OS_MACOSX)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WindowDrag,
WindowSimulateDrag)
#endif // !defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(AutomationMsg_HandleUnused, HandleUnused)
- IPC_MESSAGE_HANDLER(AutomationMsg_SetProxyConfig, SetProxyConfig);
+ IPC_MESSAGE_HANDLER(AutomationMsg_SetProxyConfig, SetProxyConfig)
IPC_MESSAGE_HANDLER(AutomationMsg_PrintAsync, PrintAsync)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_Find, HandleFindRequest)
IPC_MESSAGE_HANDLER(AutomationMsg_OverrideEncoding, OverrideEncoding)
@@ -429,8 +430,9 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_LoginWithUserAndPass,
LoginWithUserAndPass)
#endif // defined(OS_CHROMEOS)
- IPC_MESSAGE_UNHANDLED(OnUnhandledMessage())
+ IPC_MESSAGE_UNHANDLED(handled = false;OnUnhandledMessage())
IPC_END_MESSAGE_MAP()
+ return handled;
}
void AutomationProvider::OnUnhandledMessage() {
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 40b9bce..4eb6f96 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -148,7 +148,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
// IPC implementations
virtual bool Send(IPC::Message* msg);
virtual void OnChannelConnected(int pid);
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
IPC::Message* reply_message_release() {
diff --git a/chrome/browser/automation/chrome_frame_automation_provider.cc b/chrome/browser/automation/chrome_frame_automation_provider.cc
index 8fb0621..7b699f1 100644
--- a/chrome/browser/automation/chrome_frame_automation_provider.cc
+++ b/chrome/browser/automation/chrome_frame_automation_provider.cc
@@ -12,13 +12,13 @@
ChromeFrameAutomationProvider::ChromeFrameAutomationProvider(Profile* profile)
: AutomationProvider(profile) {}
-void ChromeFrameAutomationProvider::OnMessageReceived(
+bool ChromeFrameAutomationProvider::OnMessageReceived(
const IPC::Message& message) {
- if (IsValidMessage(message.type())) {
- AutomationProvider::OnMessageReceived(message);
- } else {
- OnUnhandledMessage(message);
- }
+ if (IsValidMessage(message.type()))
+ return AutomationProvider::OnMessageReceived(message);
+
+ OnUnhandledMessage(message);
+ return false;
}
void ChromeFrameAutomationProvider::OnUnhandledMessage(
diff --git a/chrome/browser/automation/chrome_frame_automation_provider.h b/chrome/browser/automation/chrome_frame_automation_provider.h
index fad6bd8..f2a67e0 100644
--- a/chrome/browser/automation/chrome_frame_automation_provider.h
+++ b/chrome/browser/automation/chrome_frame_automation_provider.h
@@ -24,7 +24,7 @@ class ChromeFrameAutomationProvider : public AutomationProvider {
explicit ChromeFrameAutomationProvider(Profile* profile);
// IPC::Channel::Listener overrides.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
protected:
// This function is called when we receive an invalid message type.
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 78afce1..103225b 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -203,8 +203,9 @@ void TestingAutomationProvider::Observe(NotificationType type,
Release();
}
-void TestingAutomationProvider::OnMessageReceived(
+bool TestingAutomationProvider::OnMessageReceived(
const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(TestingAutomationProvider, message)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_CloseBrowser, CloseBrowser)
IPC_MESSAGE_HANDLER(AutomationMsg_CloseBrowserRequestAsync,
@@ -389,8 +390,10 @@ void TestingAutomationProvider::OnMessageReceived(
IPC_MESSAGE_HANDLER(AutomationMsg_LoadBlockedPlugins, LoadBlockedPlugins)
IPC_MESSAGE_HANDLER(AutomationMsg_ResetToDefaultTheme, ResetToDefaultTheme)
- IPC_MESSAGE_UNHANDLED(AutomationProvider::OnMessageReceived(message));
+ IPC_MESSAGE_UNHANDLED(
+ handled = AutomationProvider::OnMessageReceived(message))
IPC_END_MESSAGE_MAP()
+ return handled;
}
void TestingAutomationProvider::OnChannelError() {
diff --git a/chrome/browser/automation/testing_automation_provider.h b/chrome/browser/automation/testing_automation_provider.h
index 57f9572..6bda672 100644
--- a/chrome/browser/automation/testing_automation_provider.h
+++ b/chrome/browser/automation/testing_automation_provider.h
@@ -33,7 +33,7 @@ class TestingAutomationProvider : public AutomationProvider,
virtual void OnBrowserRemoved(const Browser* browser);
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
private:
diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc
index 511747b..9e374c4 100644
--- a/chrome/browser/gpu_process_host.cc
+++ b/chrome/browser/gpu_process_host.cc
@@ -132,13 +132,14 @@ bool GpuProcessHost::Send(IPC::Message* msg) {
return BrowserChildProcessHost::Send(msg);
}
-void GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
+bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());
if (message.routing_id() == MSG_ROUTING_CONTROL)
- OnControlMessageReceived(message);
- else
- RouteOnUIThread(message);
+ return OnControlMessageReceived(message);
+
+ RouteOnUIThread(message);
+ return true;
}
void GpuProcessHost::EstablishGpuChannel(int renderer_id,
@@ -178,7 +179,7 @@ GpuProcessHost::SynchronizationRequest::SynchronizationRequest(
GpuProcessHost::SynchronizationRequest::~SynchronizationRequest() {}
-void GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) {
+bool GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());
IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message)
@@ -202,6 +203,8 @@ void GpuProcessHost::OnControlMessageReceived(const IPC::Message& message) {
// handle it.
IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message))
IPC_END_MESSAGE_MAP()
+
+ return true;
}
void GpuProcessHost::OnChannelEstablished(
diff --git a/chrome/browser/gpu_process_host.h b/chrome/browser/gpu_process_host.h
index a1b7c8c..14edf88 100644
--- a/chrome/browser/gpu_process_host.h
+++ b/chrome/browser/gpu_process_host.h
@@ -37,7 +37,7 @@ class GpuProcessHost : public BrowserChildProcessHost, public NonThreadSafe {
virtual bool Send(IPC::Message* msg);
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// Tells the GPU process to create a new channel for communication with a
// renderer. Will asynchronously send message to object with given routing id
@@ -77,7 +77,7 @@ class GpuProcessHost : public BrowserChildProcessHost, public NonThreadSafe {
bool EnsureInitialized();
bool Init();
- void OnControlMessageReceived(const IPC::Message& message);
+ bool OnControlMessageReceived(const IPC::Message& message);
// Message handlers.
void OnChannelEstablished(const IPC::ChannelHandle& channel_handle,
diff --git a/chrome/browser/gpu_process_host_ui_shim.cc b/chrome/browser/gpu_process_host_ui_shim.cc
index d6b7d6a..87c7be2 100644
--- a/chrome/browser/gpu_process_host_ui_shim.cc
+++ b/chrome/browser/gpu_process_host_ui_shim.cc
@@ -63,13 +63,13 @@ void GpuProcessHostUIShim::RemoveRoute(int32 routing_id) {
router_.RemoveRoute(routing_id);
}
-void GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
+bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());
if (message.routing_id() == MSG_ROUTING_CONTROL)
- OnControlMessageReceived(message);
- else
- router_.RouteMessage(message);
+ return OnControlMessageReceived(message);
+
+ return router_.RouteMessage(message);
}
void GpuProcessHostUIShim::CollectGraphicsInfoAsynchronously() {
@@ -119,7 +119,8 @@ void GpuProcessHostUIShim::OnScheduleComposite(int renderer_id,
}
host->ScheduleComposite();
}
-void GpuProcessHostUIShim::OnControlMessageReceived(
+
+bool GpuProcessHostUIShim::OnControlMessageReceived(
const IPC::Message& message) {
DCHECK(CalledOnValidThread());
@@ -127,9 +128,10 @@ void GpuProcessHostUIShim::OnControlMessageReceived(
IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected,
OnGraphicsInfoCollected)
#if defined(OS_WIN)
- IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite,
- OnScheduleComposite);
+ IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, OnScheduleComposite);
#endif
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
+
+ return true;
}
diff --git a/chrome/browser/gpu_process_host_ui_shim.h b/chrome/browser/gpu_process_host_ui_shim.h
index d0d0f37..f261093d 100644
--- a/chrome/browser/gpu_process_host_ui_shim.h
+++ b/chrome/browser/gpu_process_host_ui_shim.h
@@ -36,7 +36,7 @@ class GpuProcessHostUIShim : public IPC::Channel::Sender,
// The GpuProcessHost causes this to be called on the UI thread to
// dispatch the incoming messages from the GPU process, which are
// actually received on the IO thread.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// See documentation on MessageRouter for AddRoute and RemoveRoute
void AddRoute(int32 routing_id, IPC::Channel::Listener* listener);
@@ -72,7 +72,7 @@ class GpuProcessHostUIShim : public IPC::Channel::Sender,
// Message handlers.
void OnGraphicsInfoCollected(const GPUInfo& gpu_info);
void OnScheduleComposite(int32 renderer_id, int32 render_view_id);
- void OnControlMessageReceived(const IPC::Message& message);
+ bool OnControlMessageReceived(const IPC::Message& message);
int last_routing_id_;
diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
index ba1b5aa..15ac4a2 100644
--- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
+++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
@@ -94,11 +94,14 @@ class FFDecryptorServerChannelListener : public IPC::Channel::Listener {
sender_->Send(new Msg_Decryptor_Quit());
}
- virtual void OnMessageReceived(const IPC::Message& msg) {
+ virtual bool OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(FFDecryptorServerChannelListener, msg)
IPC_MESSAGE_HANDLER(Msg_Decryptor_InitReturnCode, OnInitDecryptorResponse)
IPC_MESSAGE_HANDLER(Msg_Decryptor_Response, OnDecryptedTextResonse)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
// If an error occured, just kill the message Loop.
@@ -231,12 +234,15 @@ class FFDecryptorClientChannelListener : public IPC::Channel::Listener {
MessageLoop::current()->Quit();
}
- virtual void OnMessageReceived(const IPC::Message& msg) {
+ virtual bool OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(FFDecryptorClientChannelListener, msg)
IPC_MESSAGE_HANDLER(Msg_Decryptor_Init, OnDecryptor_Init)
IPC_MESSAGE_HANDLER(Msg_Decrypt, OnDecrypt)
IPC_MESSAGE_HANDLER(Msg_Decryptor_Quit, OnQuitRequest)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
virtual void OnChannelError() {
diff --git a/chrome/browser/nacl_host/nacl_broker_host_win.cc b/chrome/browser/nacl_host/nacl_broker_host_win.cc
index 0942a23..7d0fbea 100644
--- a/chrome/browser/nacl_host/nacl_broker_host_win.cc
+++ b/chrome/browser/nacl_host/nacl_broker_host_win.cc
@@ -46,10 +46,13 @@ bool NaClBrokerHost::Init() {
return true;
}
-void NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) {
+bool NaClBrokerHost::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NaClBrokerHost, msg)
IPC_MESSAGE_HANDLER(NaClProcessMsg_LoaderLaunched, OnLoaderLaunched)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
bool NaClBrokerHost::LaunchLoader(
diff --git a/chrome/browser/nacl_host/nacl_broker_host_win.h b/chrome/browser/nacl_host/nacl_broker_host_win.h
index 7213ff0..27ceb24 100644
--- a/chrome/browser/nacl_host/nacl_broker_host_win.h
+++ b/chrome/browser/nacl_host/nacl_broker_host_win.h
@@ -33,7 +33,7 @@ class NaClBrokerHost : public BrowserChildProcessHost {
base::ProcessHandle handle);
// IPC::Channel::Listener
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
bool stopping_;
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index f9f5667..a009702 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -282,8 +282,9 @@ void NaClProcessHost::SendStartMessage() {
sockets_for_sel_ldr_.clear();
}
-void NaClProcessHost::OnMessageReceived(const IPC::Message& msg) {
+bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) {
NOTREACHED() << "Invalid message with type = " << msg.type();
+ return false;
}
bool NaClProcessHost::CanShutdown() {
diff --git a/chrome/browser/nacl_host/nacl_process_host.h b/chrome/browser/nacl_host/nacl_process_host.h
index e2b0c39..c0d5731 100644
--- a/chrome/browser/nacl_host/nacl_process_host.h
+++ b/chrome/browser/nacl_host/nacl_process_host.h
@@ -32,7 +32,7 @@ class NaClProcessHost : public BrowserChildProcessHost {
int socket_count,
IPC::Message* reply_msg);
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
void OnProcessLaunchedByBroker(base::ProcessHandle handle);
diff --git a/chrome/browser/plugin_data_remover.cc b/chrome/browser/plugin_data_remover.cc
index fd7d9bd..2baf0d0 100644
--- a/chrome/browser/plugin_data_remover.cc
+++ b/chrome/browser/plugin_data_remover.cc
@@ -115,12 +115,14 @@ void PluginDataRemover::OnTimeout() {
SignalDone();
}
-void PluginDataRemover::OnMessageReceived(const IPC::Message& msg) {
+bool PluginDataRemover::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(PluginDataRemover, msg)
IPC_MESSAGE_HANDLER(PluginHostMsg_ClearSiteDataResult,
OnClearSiteDataResult)
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
+
+ return true;
}
void PluginDataRemover::OnChannelError() {
diff --git a/chrome/browser/plugin_data_remover.h b/chrome/browser/plugin_data_remover.h
index 58387fe..77f7f58 100644
--- a/chrome/browser/plugin_data_remover.h
+++ b/chrome/browser/plugin_data_remover.h
@@ -45,8 +45,8 @@ class PluginDataRemover : public base::RefCountedThreadSafe<PluginDataRemover>,
virtual void OnChannelOpened(const IPC::ChannelHandle& handle);
virtual void OnError();
- // IPC::ChannelProxy::MessageFilter methods
- virtual void OnMessageReceived(const IPC::Message& message);
+ // IPC::Channel::Listener methods
+ virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();
private:
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index 4be2ce7..cb99a80 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -298,7 +298,8 @@ void PluginProcessHost::OnProcessLaunched() {
}
}
-void PluginProcessHost::OnMessageReceived(const IPC::Message& msg) {
+bool PluginProcessHost::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PluginProcessHost, msg)
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_ChannelCreated, OnChannelCreated)
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_GetPluginFinderUrl,
@@ -327,8 +328,11 @@ void PluginProcessHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PluginProcessHostMsg_PluginSetCursorVisibility,
OnPluginSetCursorVisibility)
#endif
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+
+ DCHECK(handled);
+ return handled;
}
void PluginProcessHost::OnChannelConnected(int32 peer_pid) {
diff --git a/chrome/browser/plugin_process_host.h b/chrome/browser/plugin_process_host.h
index b98840e..d30a77a 100644
--- a/chrome/browser/plugin_process_host.h
+++ b/chrome/browser/plugin_process_host.h
@@ -66,7 +66,7 @@ class PluginProcessHost : public BrowserChildProcessHost,
// Force the plugin process to shutdown (cleanly).
virtual void ForceShutdown();
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
diff --git a/chrome/browser/ppapi_plugin_process_host.cc b/chrome/browser/ppapi_plugin_process_host.cc
index b9be47a..c90d1f4 100644
--- a/chrome/browser/ppapi_plugin_process_host.cc
+++ b/chrome/browser/ppapi_plugin_process_host.cc
@@ -69,11 +69,14 @@ bool PpapiPluginProcessHost::CanShutdown() {
void PpapiPluginProcessHost::OnProcessLaunched() {
}
-void PpapiPluginProcessHost::OnMessageReceived(const IPC::Message& msg) {
+bool PpapiPluginProcessHost::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PpapiPluginProcessHost, msg)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PluginLoaded, OnPluginLoaded)
- IPC_MESSAGE_UNHANDLED_ERROR();
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
void PpapiPluginProcessHost::OnChannelConnected(int32 peer_pid) {
diff --git a/chrome/browser/ppapi_plugin_process_host.h b/chrome/browser/ppapi_plugin_process_host.h
index 23be5da..227cf31 100644
--- a/chrome/browser/ppapi_plugin_process_host.h
+++ b/chrome/browser/ppapi_plugin_process_host.h
@@ -23,7 +23,7 @@ class PpapiPluginProcessHost : public BrowserChildProcessHost {
virtual bool CanShutdown();
virtual void OnProcessLaunched();
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
diff --git a/chrome/browser/profile_import_process_host.cc b/chrome/browser/profile_import_process_host.cc
index d221817..3663ef7 100644
--- a/chrome/browser/profile_import_process_host.cc
+++ b/chrome/browser/profile_import_process_host.cc
@@ -118,13 +118,14 @@ bool ProfileImportProcessHost::StartProcess() {
return true;
}
-void ProfileImportProcessHost::OnMessageReceived(const IPC::Message& message) {
+bool ProfileImportProcessHost::OnMessageReceived(const IPC::Message& message) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
BrowserThread::PostTask(
thread_id_, FROM_HERE,
NewRunnableMethod(import_process_client_.get(),
&ImportProcessClient::OnMessageReceived,
message));
+ return true;
}
void ProfileImportProcessHost::OnProcessCrashed(int exit_code) {
@@ -144,8 +145,9 @@ ProfileImportProcessHost::ImportProcessClient::ImportProcessClient() {}
ProfileImportProcessHost::ImportProcessClient::~ImportProcessClient() {}
-void ProfileImportProcessHost::ImportProcessClient::OnMessageReceived(
+bool ProfileImportProcessHost::ImportProcessClient::OnMessageReceived(
const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ProfileImportProcessHost, message)
// Notification messages about the state of the import process.
IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_Import_Started,
@@ -176,5 +178,7 @@ void ProfileImportProcessHost::ImportProcessClient::OnMessageReceived(
ImportProcessClient::OnPasswordFormImportReady)
IPC_MESSAGE_HANDLER(ProfileImportProcessHostMsg_NotifyKeywordsReady,
ImportProcessClient::OnKeywordsImportReady)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
+ return handled;
}
diff --git a/chrome/browser/profile_import_process_host.h b/chrome/browser/profile_import_process_host.h
index 68ef64f..dae6108 100644
--- a/chrome/browser/profile_import_process_host.h
+++ b/chrome/browser/profile_import_process_host.h
@@ -73,7 +73,7 @@ class ProfileImportProcessHost : public BrowserChildProcessHost {
const std::vector<TemplateURL>& template_urls,
int default_keyword_index, bool unique_on_host_and_path) {}
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
protected:
friend class base::RefCountedThreadSafe<ImportProcessClient>;
@@ -122,7 +122,7 @@ class ProfileImportProcessHost : public BrowserChildProcessHost {
// Called by the external importer process to send messages back to the
// ImportProcessClient.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// Overridden from BrowserChildProcessHost:
virtual void OnProcessCrashed(int exit_code);
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 66968b7..e3849fb 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -977,11 +977,11 @@ bool BrowserRenderProcessHost::Send(IPC::Message* msg) {
return channel_->Send(msg);
}
-void BrowserRenderProcessHost::OnMessageReceived(const IPC::Message& msg) {
+bool BrowserRenderProcessHost::OnMessageReceived(const IPC::Message& msg) {
// If we're about to be deleted, we can no longer trust that our profile is
// valid, so we ignore incoming messages.
if (deleting_soon_)
- return;
+ return false;
#if defined(OS_CHROMEOS)
// To troubleshoot crosbug.com/7327.
@@ -1018,7 +1018,7 @@ void BrowserRenderProcessHost::OnMessageReceived(const IPC::Message& msg) {
UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_BRPH"));
ReceivedBadMessage();
}
- return;
+ return true;
}
// Dispatch incoming messages to the appropriate RenderView/WidgetHost.
@@ -1031,9 +1031,9 @@ void BrowserRenderProcessHost::OnMessageReceived(const IPC::Message& msg) {
reply->set_reply_error();
Send(reply);
}
- return;
+ return true;
}
- listener->OnMessageReceived(msg);
+ return listener->OnMessageReceived(msg);
}
void BrowserRenderProcessHost::OnChannelConnected(int32 peer_pid) {
diff --git a/chrome/browser/renderer_host/browser_render_process_host.h b/chrome/browser/renderer_host/browser_render_process_host.h
index 3b28e6b..f1bc47a 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.h
+++ b/chrome/browser/renderer_host/browser_render_process_host.h
@@ -85,7 +85,7 @@ class BrowserRenderProcessHost : public RenderProcessHost,
virtual bool Send(IPC::Message* msg);
// IPC::Channel::Listener via RenderProcessHost.
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
diff --git a/chrome/browser/renderer_host/mock_render_process_host.cc b/chrome/browser/renderer_host/mock_render_process_host.cc
index bd4d675..1f1a2b3 100644
--- a/chrome/browser/renderer_host/mock_render_process_host.cc
+++ b/chrome/browser/renderer_host/mock_render_process_host.cc
@@ -117,7 +117,8 @@ TransportDIB* MockRenderProcessHost::GetTransportDIB(TransportDIB::Id dib_id) {
return transport_dib_;
}
-void MockRenderProcessHost::OnMessageReceived(const IPC::Message& msg) {
+bool MockRenderProcessHost::OnMessageReceived(const IPC::Message& msg) {
+ return false;
}
void MockRenderProcessHost::OnChannelConnected(int32 peer_pid) {
diff --git a/chrome/browser/renderer_host/mock_render_process_host.h b/chrome/browser/renderer_host/mock_render_process_host.h
index 0d8bfa6..6309685 100644
--- a/chrome/browser/renderer_host/mock_render_process_host.h
+++ b/chrome/browser/renderer_host/mock_render_process_host.h
@@ -59,7 +59,7 @@ class MockRenderProcessHost : public RenderProcessHost {
virtual bool Send(IPC::Message* msg);
// IPC::Channel::Listener via RenderProcessHost.
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
// Attaches the factory object so we can remove this object in its destructor
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index df012bf..950c60e 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -738,7 +738,7 @@ bool RenderViewHost::SuddenTerminationAllowed() const {
///////////////////////////////////////////////////////////////////////////////
// RenderViewHost, IPC message handlers:
-void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
+bool RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
#if defined(OS_WIN)
// On Windows there's a potential deadlock with sync messsages going in
// a circle from browser -> plugin -> renderer -> browser.
@@ -756,10 +756,11 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC::Message* reply = IPC::SyncMessage::GenerateReply(&msg);
reply->set_reply_error();
Send(reply);
- return;
+ return true;
}
#endif
+ bool handled = true;
bool msg_is_ok = true;
IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHost, msg, msg_is_ok)
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnMsgShowView)
@@ -917,7 +918,7 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_PagesReadyForPreview,
OnPagesReadyForPreview)
// Have the super handle all other messages.
- IPC_MESSAGE_UNHANDLED(RenderWidgetHost::OnMessageReceived(msg))
+ IPC_MESSAGE_UNHANDLED(handled = RenderWidgetHost::OnMessageReceived(msg))
IPC_END_MESSAGE_MAP_EX()
if (!msg_is_ok) {
@@ -926,6 +927,8 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RVH"));
process()->ReceivedBadMessage();
}
+
+ return handled;
}
void RenderViewHost::Shutdown() {
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index 163039b..02c08d1 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -446,7 +446,7 @@ class RenderViewHost : public RenderWidgetHost {
// RenderWidgetHost public overrides.
virtual void Shutdown();
virtual bool IsRenderView() const;
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void GotFocus();
virtual void LostCapture();
virtual void ForwardMouseEvent(const WebKit::WebMouseEvent& mouse_event);
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index 3c319e0..28862af 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -151,7 +151,8 @@ bool RenderWidgetHost::IsRenderView() const {
return false;
}
-void RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) {
+bool RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) {
+ bool handled = true;
bool msg_is_ok = true;
IPC_BEGIN_MESSAGE_MAP_EX(RenderWidgetHost, msg, msg_is_ok)
IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnMsgRenderViewReady)
@@ -192,7 +193,7 @@ void RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyPluginContainer,
OnMsgDestroyPluginContainer)
#endif
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
if (!msg_is_ok) {
@@ -200,6 +201,7 @@ void RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) {
UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RWH"));
process()->ReceivedBadMessage();
}
+ return handled;
}
bool RenderWidgetHost::Send(IPC::Message* msg) {
diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h
index 90204aa..73d7fa4 100644
--- a/chrome/browser/renderer_host/render_widget_host.h
+++ b/chrome/browser/renderer_host/render_widget_host.h
@@ -181,7 +181,7 @@ class RenderWidgetHost : public IPC::Channel::Listener,
virtual bool IsRenderView() const;
// IPC::Channel::Listener
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
// Sends a message to the corresponding object in the renderer.
virtual bool Send(IPC::Message* msg);
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.cc b/chrome/browser/renderer_host/test/test_render_view_host.cc
index 72674497..1c2e4b4 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.cc
+++ b/chrome/browser/renderer_host/test/test_render_view_host.cc
@@ -70,8 +70,8 @@ bool TestRenderViewHost::IsRenderViewLive() const {
return render_view_created_;
}
-void TestRenderViewHost::TestOnMessageReceived(const IPC::Message& msg) {
- OnMessageReceived(msg);
+bool TestRenderViewHost::TestOnMessageReceived(const IPC::Message& msg) {
+ return OnMessageReceived(msg);
}
void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) {
diff --git a/chrome/browser/renderer_host/test/test_render_view_host.h b/chrome/browser/renderer_host/test/test_render_view_host.h
index f84bc21..70f2d11 100644
--- a/chrome/browser/renderer_host/test/test_render_view_host.h
+++ b/chrome/browser/renderer_host/test/test_render_view_host.h
@@ -166,7 +166,7 @@ class TestRenderViewHost : public RenderViewHost {
// Calls the RenderViewHosts' private OnMessageReceived function with the
// given message.
- void TestOnMessageReceived(const IPC::Message& msg);
+ bool TestOnMessageReceived(const IPC::Message& msg);
// Calls OnMsgNavigate on the RenderViewHost with the given information,
// setting the rest of the parameters in the message to the "typical" values.
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index dfba80a..27e3a2d 100644
--- a/chrome/browser/service/service_process_control.cc
+++ b/chrome/browser/service/service_process_control.cc
@@ -238,14 +238,17 @@ void ServiceProcessControl::OnProcessLaunched() {
launcher_ = NULL;
}
-void ServiceProcessControl::OnMessageReceived(const IPC::Message& message) {
+bool ServiceProcessControl::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;;
IPC_BEGIN_MESSAGE_MAP(ServiceProcessControl, message)
- IPC_MESSAGE_HANDLER(ServiceHostMsg_GoodDay, OnGoodDay)
- IPC_MESSAGE_HANDLER(ServiceHostMsg_CloudPrintProxy_IsEnabled,
- OnCloudPrintProxyIsEnabled)
- IPC_MESSAGE_HANDLER(ServiceHostMsg_RemotingHost_HostInfo,
- OnRemotingHostInfo)
+ IPC_MESSAGE_HANDLER(ServiceHostMsg_GoodDay, OnGoodDay)
+ IPC_MESSAGE_HANDLER(ServiceHostMsg_CloudPrintProxy_IsEnabled,
+ OnCloudPrintProxyIsEnabled)
+ IPC_MESSAGE_HANDLER(ServiceHostMsg_RemotingHost_HostInfo,
+ OnRemotingHostInfo)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void ServiceProcessControl::OnChannelConnected(int32 peer_pid) {
diff --git a/chrome/browser/service/service_process_control.h b/chrome/browser/service/service_process_control.h
index efbd545..9162736 100644
--- a/chrome/browser/service/service_process_control.h
+++ b/chrome/browser/service/service_process_control.h
@@ -77,7 +77,7 @@ class ServiceProcessControl : public IPC::Channel::Sender,
void Launch(Task* success_task, Task* failure_task);
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc
index ab5b39f..4d208fd 100644
--- a/chrome/browser/utility_process_host.cc
+++ b/chrome/browser/utility_process_host.cc
@@ -153,10 +153,11 @@ bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) {
return true;
}
-void UtilityProcessHost::OnMessageReceived(const IPC::Message& message) {
+bool UtilityProcessHost::OnMessageReceived(const IPC::Message& message) {
BrowserThread::PostTask(
client_thread_id_, FROM_HERE,
NewRunnableMethod(client_.get(), &Client::OnMessageReceived, message));
+ return true;
}
void UtilityProcessHost::OnProcessCrashed(int exit_code) {
@@ -169,8 +170,9 @@ bool UtilityProcessHost::CanShutdown() {
return true;
}
-void UtilityProcessHost::Client::OnMessageReceived(
+bool UtilityProcessHost::Client::OnMessageReceived(
const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(UtilityProcessHost, message)
IPC_MESSAGE_HANDLER(UtilityHostMsg_UnpackExtension_Succeeded,
Client::OnUnpackExtensionSucceeded)
@@ -192,5 +194,7 @@ void UtilityProcessHost::Client::OnMessageReceived(
Client::OnIDBKeysFromValuesAndKeyPathSucceeded)
IPC_MESSAGE_HANDLER(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed,
Client::OnIDBKeysFromValuesAndKeyPathFailed)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
+ return handled;
}
diff --git a/chrome/browser/utility_process_host.h b/chrome/browser/utility_process_host.h
index 21776b6..c1f4055 100644
--- a/chrome/browser/utility_process_host.h
+++ b/chrome/browser/utility_process_host.h
@@ -97,7 +97,7 @@ class UtilityProcessHost : public BrowserChildProcessHost {
private:
friend class UtilityProcessHost;
- void OnMessageReceived(const IPC::Message& message);
+ bool OnMessageReceived(const IPC::Message& message);
DISALLOW_COPY_AND_ASSIGN(Client);
};
@@ -149,7 +149,7 @@ class UtilityProcessHost : public BrowserChildProcessHost {
bool StartProcess(const FilePath& exposed_dir);
// IPC messages:
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// BrowserChildProcessHost:
virtual void OnProcessCrashed(int exit_code);
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc
index 6167132..2006e2f 100644
--- a/chrome/browser/worker_host/worker_process_host.cc
+++ b/chrome/browser/worker_host/worker_process_host.cc
@@ -276,7 +276,7 @@ bool WorkerProcessHost::FilterMessage(const IPC::Message& message,
void WorkerProcessHost::OnProcessLaunched() {
}
-void WorkerProcessHost::OnMessageReceived(const IPC::Message& message) {
+bool WorkerProcessHost::OnMessageReceived(const IPC::Message& message) {
bool msg_is_ok = true;
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(WorkerProcessHost, message, msg_is_ok)
@@ -293,7 +293,7 @@ void WorkerProcessHost::OnMessageReceived(const IPC::Message& message) {
}
if (handled)
- return;
+ return true;
for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) {
if (i->worker_route_id() == message.routing_id()) {
@@ -308,9 +308,10 @@ void WorkerProcessHost::OnMessageReceived(const IPC::Message& message) {
instances_.erase(i);
UpdateTitle();
}
- break;
+ return true;
}
}
+ return false;
}
// Sent to notify the browser process when a worker context invokes close(), so
diff --git a/chrome/browser/worker_host/worker_process_host.h b/chrome/browser/worker_host/worker_process_host.h
index 150da93..f3f6fdd 100644
--- a/chrome/browser/worker_host/worker_process_host.h
+++ b/chrome/browser/worker_host/worker_process_host.h
@@ -149,7 +149,7 @@ class WorkerProcessHost : public BrowserChildProcessHost {
// IPC::Channel::Listener implementation:
// Called when a message arrives from the worker process.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
void OnWorkerContextClosed(int worker_route_id);
void OnAllowDatabase(int worker_route_id,
diff --git a/chrome/common/appcache/appcache_dispatcher.h b/chrome/common/appcache/appcache_dispatcher.h
index f099183..f88a38a 100644
--- a/chrome/common/appcache/appcache_dispatcher.h
+++ b/chrome/common/appcache/appcache_dispatcher.h
@@ -9,20 +9,21 @@
#include <string>
#include <vector>
#include "chrome/common/appcache/appcache_backend_proxy.h"
-#include "ipc/ipc_message.h"
+#include "ipc/ipc_channel.h"
#include "webkit/appcache/appcache_frontend_impl.h"
// Dispatches appcache related messages sent to a child process from the
// main browser process. There is one instance per child process. Messages
// are dispatched on the main child thread. The ChildThread base class
// creates an instance and delegates calls to it.
-class AppCacheDispatcher {
+class AppCacheDispatcher : public IPC::Channel::Listener {
public:
explicit AppCacheDispatcher(IPC::Message::Sender* sender)
: backend_proxy_(sender) {}
AppCacheBackendProxy* backend_proxy() { return &backend_proxy_; }
+ // IPC::Channel::Listener implementation
bool OnMessageReceived(const IPC::Message& msg);
private:
diff --git a/chrome/common/child_process_host.cc b/chrome/common/child_process_host.cc
index c19d0ca..e03b3a6 100644
--- a/chrome/common/child_process_host.cc
+++ b/chrome/common/child_process_host.cc
@@ -155,13 +155,13 @@ ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host)
: host_(host) {
}
-void ChildProcessHost::ListenerHook::OnMessageReceived(
+bool ChildProcessHost::ListenerHook::OnMessageReceived(
const IPC::Message& msg) {
#ifdef IPC_MESSAGE_LOG_ENABLED
IPC::Logging* logger = IPC::Logging::GetInstance();
if (msg.type() == IPC_LOGGING_ID) {
logger->OnReceivedLoggingMessage(msg);
- return;
+ return true;
}
if (logger->Enabled())
@@ -183,12 +183,13 @@ void ChildProcessHost::ListenerHook::OnMessageReceived(
}
if (!handled)
- host_->OnMessageReceived(msg);
+ handled = host_->OnMessageReceived(msg);
#ifdef IPC_MESSAGE_LOG_ENABLED
if (logger->Enabled())
logger->OnPostDispatchMessage(msg, host_->channel_id_);
#endif
+ return handled;
}
void ChildProcessHost::ListenerHook::OnChannelConnected(int32 peer_pid) {
diff --git a/chrome/common/child_process_host.h b/chrome/common/child_process_host.h
index 3b467ec..c822346 100644
--- a/chrome/common/child_process_host.h
+++ b/chrome/common/child_process_host.h
@@ -80,7 +80,7 @@ class ChildProcessHost : public IPC::Channel::Listener,
virtual void InstanceCreated();
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg) { }
+ virtual bool OnMessageReceived(const IPC::Message& msg) { return false; }
virtual void OnChannelConnected(int32 peer_pid) { }
virtual void OnChannelError() { }
@@ -102,7 +102,7 @@ class ChildProcessHost : public IPC::Channel::Listener,
class ListenerHook : public IPC::Channel::Listener {
public:
explicit ListenerHook(ChildProcessHost* host);
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
private:
diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc
index 2a46de8..53823bc 100644
--- a/chrome/common/child_thread.cc
+++ b/chrome/common/child_thread.cc
@@ -139,14 +139,14 @@ MessageLoop* ChildThread::message_loop() {
return message_loop_;
}
-void ChildThread::OnMessageReceived(const IPC::Message& msg) {
+bool ChildThread::OnMessageReceived(const IPC::Message& msg) {
// Resource responses are sent to the resource dispatcher.
if (resource_dispatcher_->OnMessageReceived(msg))
- return;
+ return true;
if (socket_stream_dispatcher_->OnMessageReceived(msg))
- return;
+ return true;
if (file_system_dispatcher_->OnMessageReceived(msg))
- return;
+ return true;
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ChildThread, msg)
@@ -160,13 +160,12 @@ void ChildThread::OnMessageReceived(const IPC::Message& msg) {
IPC_END_MESSAGE_MAP()
if (handled)
- return;
+ return true;
- if (msg.routing_id() == MSG_ROUTING_CONTROL) {
- OnControlMessageReceived(msg);
- } else {
- router_.OnMessageReceived(msg);
- }
+ if (msg.routing_id() == MSG_ROUTING_CONTROL)
+ return OnControlMessageReceived(msg);
+
+ return router_.OnMessageReceived(msg);
}
void ChildThread::OnAskBeforeShutdown() {
diff --git a/chrome/common/child_thread.h b/chrome/common/child_thread.h
index 337a7f8..dbe8677 100644
--- a/chrome/common/child_thread.h
+++ b/chrome/common/child_thread.h
@@ -74,7 +74,9 @@ class ChildThread : public IPC::Channel::Listener,
// Called when the process refcount is 0.
void OnProcessFinalRelease();
- virtual void OnControlMessageReceived(const IPC::Message& msg) { }
+ virtual bool OnControlMessageReceived(const IPC::Message& msg) {
+ return false;
+ }
virtual void OnAskBeforeShutdown();
virtual void OnShutdown();
@@ -92,7 +94,7 @@ class ChildThread : public IPC::Channel::Listener,
void Init();
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
std::string channel_name_;
diff --git a/chrome/common/file_system/file_system_dispatcher.h b/chrome/common/file_system/file_system_dispatcher.h
index b8ffb2c..21bc792 100644
--- a/chrome/common/file_system/file_system_dispatcher.h
+++ b/chrome/common/file_system/file_system_dispatcher.h
@@ -25,11 +25,12 @@ class GURL;
// Dispatches and sends file system related messages sent to/from a child
// process from/to the main browser process. There is one instance
// per child process. Messages are dispatched on the main child thread.
-class FileSystemDispatcher {
+class FileSystemDispatcher : public IPC::Channel::Listener {
public:
FileSystemDispatcher();
~FileSystemDispatcher();
+ // IPC::Channel::Listener implementation.
bool OnMessageReceived(const IPC::Message& msg);
bool OpenFileSystem(const GURL& origin_url,
diff --git a/chrome/common/message_router.cc b/chrome/common/message_router.cc
index 6bd6e95..b3ea5960 100644
--- a/chrome/common/message_router.cc
+++ b/chrome/common/message_router.cc
@@ -10,9 +10,10 @@ MessageRouter::MessageRouter() {
MessageRouter::~MessageRouter() {
}
-void MessageRouter::OnControlMessageReceived(const IPC::Message& msg) {
+bool MessageRouter::OnControlMessageReceived(const IPC::Message& msg) {
NOTREACHED() <<
"should override in subclass if you care about control messages";
+ return false;
}
bool MessageRouter::Send(IPC::Message* msg) {
@@ -30,12 +31,11 @@ void MessageRouter::RemoveRoute(int32 routing_id) {
routes_.Remove(routing_id);
}
-void MessageRouter::OnMessageReceived(const IPC::Message& msg) {
- if (msg.routing_id() == MSG_ROUTING_CONTROL) {
- OnControlMessageReceived(msg);
- } else {
- RouteMessage(msg);
- }
+bool MessageRouter::OnMessageReceived(const IPC::Message& msg) {
+ if (msg.routing_id() == MSG_ROUTING_CONTROL)
+ return OnControlMessageReceived(msg);
+
+ return RouteMessage(msg);
}
bool MessageRouter::RouteMessage(const IPC::Message& msg) {
diff --git a/chrome/common/message_router.h b/chrome/common/message_router.h
index 6a61091..e6709be 100644
--- a/chrome/common/message_router.h
+++ b/chrome/common/message_router.h
@@ -34,10 +34,10 @@ class MessageRouter : public IPC::Channel::Listener,
virtual ~MessageRouter();
// Implemented by subclasses to handle control messages
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
// Like OnMessageReceived, except it only handles routed messages. Returns
// true if the message was dispatched, or false if there was no listener for
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index 3ca3492..52c6589 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -23,13 +23,12 @@ struct ResourceResponseHead;
// This class serves as a communication interface between the
// ResourceDispatcherHost in the browser process and the ResourceLoaderBridge in
// the child process. It can be used from any child process.
-class ResourceDispatcher {
+class ResourceDispatcher : public IPC::Channel::Listener {
public:
explicit ResourceDispatcher(IPC::Message::Sender* sender);
~ResourceDispatcher();
- // Called to possibly handle the incoming IPC message. Returns true if
- // handled, else false.
+ // IPC::Channel::Listener implementation.
bool OnMessageReceived(const IPC::Message& message);
// Creates a ResourceLoaderBridge for this type of dispatcher, this is so
diff --git a/chrome/common/socket_stream_dispatcher.h b/chrome/common/socket_stream_dispatcher.h
index e0bf58f..01c5421 100644
--- a/chrome/common/socket_stream_dispatcher.h
+++ b/chrome/common/socket_stream_dispatcher.h
@@ -9,10 +9,7 @@
#include <vector>
#include "base/basictypes.h"
-
-namespace IPC {
-class Message;
-}
+#include "ipc/ipc_channel.h"
namespace WebKit {
class WebSocketStreamHandle;
@@ -27,7 +24,7 @@ class WebSocketStreamHandleDelegate;
// main browser process. There is one instance per child process. Messages
// are dispatched on the main child thread. The RenderThread class
// creates an instance of SocketStreamDispatcher and delegates calls to it.
-class SocketStreamDispatcher {
+class SocketStreamDispatcher : public IPC::Channel::Listener {
public:
SocketStreamDispatcher();
~SocketStreamDispatcher() {}
@@ -35,6 +32,8 @@ class SocketStreamDispatcher {
static webkit_glue::WebSocketStreamHandleBridge* CreateBridge(
WebKit::WebSocketStreamHandle* handle,
webkit_glue::WebSocketStreamHandleDelegate* delegate);
+
+ // IPC::Channel::Listener implementation.
bool OnMessageReceived(const IPC::Message& msg);
private:
diff --git a/chrome/common/webmessageportchannel_impl.cc b/chrome/common/webmessageportchannel_impl.cc
index b7a9388..0778871 100644
--- a/chrome/common/webmessageportchannel_impl.cc
+++ b/chrome/common/webmessageportchannel_impl.cc
@@ -180,11 +180,14 @@ void WebMessagePortChannelImpl::Send(IPC::Message* message) {
ChildThread::current()->Send(message);
}
-void WebMessagePortChannelImpl::OnMessageReceived(const IPC::Message& message) {
+bool WebMessagePortChannelImpl::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebMessagePortChannelImpl, message)
IPC_MESSAGE_HANDLER(WorkerProcessMsg_Message, OnMessage)
IPC_MESSAGE_HANDLER(WorkerProcessMsg_MessagesQueued, OnMessagedQueued)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void WebMessagePortChannelImpl::OnMessage(
diff --git a/chrome/common/webmessageportchannel_impl.h b/chrome/common/webmessageportchannel_impl.h
index 3c96fc38..0199ebb 100644
--- a/chrome/common/webmessageportchannel_impl.h
+++ b/chrome/common/webmessageportchannel_impl.h
@@ -48,7 +48,7 @@ class WebMessagePortChannelImpl
void Send(IPC::Message* message);
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
void OnMessage(const string16& message,
const std::vector<int>& sent_message_port_ids,
diff --git a/chrome/gpu/gpu_channel.cc b/chrome/gpu/gpu_channel.cc
index 8fb5024..79e9186 100644
--- a/chrome/gpu/gpu_channel.cc
+++ b/chrome/gpu/gpu_channel.cc
@@ -38,19 +38,18 @@ void GpuChannel::OnChannelConnected(int32 peer_pid) {
}
}
-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 @@ bool GpuChannel::IsRenderViewGone(int32 renderer_route_id) {
}
#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 @@ void GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
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() {
diff --git a/chrome/gpu/gpu_channel.h b/chrome/gpu/gpu_channel.h
index e449dc4..1706e03 100644
--- a/chrome/gpu/gpu_channel.h
+++ b/chrome/gpu/gpu_channel.h
@@ -46,7 +46,7 @@ class GpuChannel : public IPC::Channel::Listener,
}
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
@@ -62,7 +62,7 @@ class GpuChannel : public IPC::Channel::Listener,
#endif
private:
- void OnControlMessageReceived(const IPC::Message& msg);
+ bool OnControlMessageReceived(const IPC::Message& msg);
int GenerateRouteID();
diff --git a/chrome/gpu/gpu_command_buffer_stub.cc b/chrome/gpu/gpu_command_buffer_stub.cc
index bf3b2d0..592e04f 100644
--- a/chrome/gpu/gpu_command_buffer_stub.cc
+++ b/chrome/gpu/gpu_command_buffer_stub.cc
@@ -169,7 +169,8 @@ GpuCommandBufferStub::~GpuCommandBufferStub() {
#endif // defined(OS_WIN)
}
-void GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
+bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(GpuCommandBufferStub, message)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Initialize, OnInitialize);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_GetState, OnGetState);
@@ -187,8 +188,10 @@ void GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetWindowSize, OnSetWindowSize);
#endif // defined(OS_MACOSX)
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
bool GpuCommandBufferStub::Send(IPC::Message* message) {
diff --git a/chrome/gpu/gpu_command_buffer_stub.h b/chrome/gpu/gpu_command_buffer_stub.h
index 66d1759..b903412 100644
--- a/chrome/gpu/gpu_command_buffer_stub.h
+++ b/chrome/gpu/gpu_command_buffer_stub.h
@@ -41,7 +41,7 @@ class GpuCommandBufferStub
virtual ~GpuCommandBufferStub();
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// IPC::Message::Sender implementation:
virtual bool Send(IPC::Message* msg);
diff --git a/chrome/gpu/gpu_thread.cc b/chrome/gpu/gpu_thread.cc
index b8c532b..e95d27f 100644
--- a/chrome/gpu/gpu_thread.cc
+++ b/chrome/gpu/gpu_thread.cc
@@ -52,8 +52,9 @@ void GpuThread::RemoveChannel(int renderer_id) {
gpu_channels_.erase(renderer_id);
}
-void GpuThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool GpuThread::OnControlMessageReceived(const IPC::Message& msg) {
bool msg_is_ok = true;
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(GpuThread, msg, msg_is_ok)
IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel)
IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel)
@@ -67,7 +68,9 @@ void GpuThread::OnControlMessageReceived(const IPC::Message& msg) {
#endif
IPC_MESSAGE_HANDLER(GpuMsg_Crash, OnCrash)
IPC_MESSAGE_HANDLER(GpuMsg_Hang, OnHang)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
+ return handled;
}
void GpuThread::OnEstablishChannel(int renderer_id) {
diff --git a/chrome/gpu/gpu_thread.h b/chrome/gpu/gpu_thread.h
index 2f2a1f9..07302d3 100644
--- a/chrome/gpu/gpu_thread.h
+++ b/chrome/gpu/gpu_thread.h
@@ -33,7 +33,7 @@ class GpuThread : public ChildThread {
private:
// ChildThread overrides.
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
// Message handlers.
void OnEstablishChannel(int renderer_id);
diff --git a/chrome/gpu/gpu_video_decoder.cc b/chrome/gpu/gpu_video_decoder.cc
index d16064c..ee213bf 100644
--- a/chrome/gpu/gpu_video_decoder.cc
+++ b/chrome/gpu/gpu_video_decoder.cc
@@ -35,7 +35,8 @@ void GpuVideoDecoder::OnChannelConnected(int32 peer_pid) {
void GpuVideoDecoder::OnChannelError() {
}
-void GpuVideoDecoder::OnMessageReceived(const IPC::Message& msg) {
+bool GpuVideoDecoder::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(GpuVideoDecoder, msg)
IPC_MESSAGE_HANDLER(GpuVideoDecoderMsg_Initialize,
OnInitialize)
@@ -51,8 +52,10 @@ void GpuVideoDecoder::OnMessageReceived(const IPC::Message& msg) {
OnProduceVideoFrame)
IPC_MESSAGE_HANDLER(GpuVideoDecoderMsg_VideoFrameAllocated,
OnVideoFrameAllocated)
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
bool GpuVideoDecoder::CreateInputTransferBuffer(
diff --git a/chrome/gpu/gpu_video_decoder.h b/chrome/gpu/gpu_video_decoder.h
index 79b9bdb..ae1da3b 100644
--- a/chrome/gpu/gpu_video_decoder.h
+++ b/chrome/gpu/gpu_video_decoder.h
@@ -102,7 +102,7 @@ class GpuVideoDecoder
// IPC::Channel::Listener implementation.
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// VideoDecodeEngine::EventHandler implementation.
virtual void OnInitializeComplete(const VideoCodecInfo& info);
diff --git a/chrome/gpu/gpu_video_service.cc b/chrome/gpu/gpu_video_service.cc
index ca9d482..fb76e02 100644
--- a/chrome/gpu/gpu_video_service.cc
+++ b/chrome/gpu/gpu_video_service.cc
@@ -36,12 +36,13 @@ void GpuVideoService::OnChannelError() {
LOG(ERROR) << "GpuVideoService::OnChannelError";
}
-void GpuVideoService::OnMessageReceived(const IPC::Message& msg) {
+bool GpuVideoService::OnMessageReceived(const IPC::Message& msg) {
#if 0
IPC_BEGIN_MESSAGE_MAP(GpuVideoService, msg)
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
#endif
+ return false;
}
bool GpuVideoService::IntializeGpuVideoService() {
diff --git a/chrome/gpu/gpu_video_service.h b/chrome/gpu/gpu_video_service.h
index b9ad6da..371cf4b 100644
--- a/chrome/gpu/gpu_video_service.h
+++ b/chrome/gpu/gpu_video_service.h
@@ -21,7 +21,7 @@ class GpuVideoService : public IPC::Channel::Listener {
// IPC::Channel::Listener.
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// TODO(hclam): Remove return value.
bool CreateVideoDecoder(GpuChannel* channel,
diff --git a/chrome/nacl/broker_thread.cc b/chrome/nacl/broker_thread.cc
index b0cdba5..984acb3 100644
--- a/chrome/nacl/broker_thread.cc
+++ b/chrome/nacl/broker_thread.cc
@@ -28,12 +28,15 @@ NaClBrokerThread* NaClBrokerThread::current() {
return static_cast<NaClBrokerThread*>(ChildThread::current());
}
-void NaClBrokerThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool NaClBrokerThread::OnControlMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NaClBrokerThread, msg)
IPC_MESSAGE_HANDLER(NaClProcessMsg_LaunchLoaderThroughBroker,
OnLaunchLoaderThroughBroker)
IPC_MESSAGE_HANDLER(NaClProcessMsg_StopBroker, OnStopBroker)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void NaClBrokerThread::OnLaunchLoaderThroughBroker(
diff --git a/chrome/nacl/broker_thread.h b/chrome/nacl/broker_thread.h
index 6590635..8b2d7c5 100644
--- a/chrome/nacl/broker_thread.h
+++ b/chrome/nacl/broker_thread.h
@@ -26,7 +26,7 @@ class NaClBrokerThread : public ChildThread {
virtual void OnChannelConnected(int32 peer_pid);
private:
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id);
void OnShareBrowserHandle(int browser_handle);
void OnStopBroker();
diff --git a/chrome/nacl/nacl_thread.cc b/chrome/nacl/nacl_thread.cc
index 15c25b9..3ea0f82 100644
--- a/chrome/nacl/nacl_thread.cc
+++ b/chrome/nacl/nacl_thread.cc
@@ -76,10 +76,13 @@ NaClThread* NaClThread::current() {
return static_cast<NaClThread*>(ChildThread::current());
}
-void NaClThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool NaClThread::OnControlMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NaClThread, msg)
IPC_MESSAGE_HANDLER(NaClProcessMsg_Start, OnStartSelLdr)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void NaClThread::OnStartSelLdr(std::vector<nacl::FileDescriptor> handles) {
diff --git a/chrome/nacl/nacl_thread.h b/chrome/nacl/nacl_thread.h
index f87fc969..b330794 100644
--- a/chrome/nacl/nacl_thread.h
+++ b/chrome/nacl/nacl_thread.h
@@ -20,7 +20,7 @@ class NaClThread : public ChildThread {
static NaClThread* current();
private:
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
void OnStartSelLdr(std::vector<nacl::FileDescriptor> handles);
int debug_enabled_;
diff --git a/chrome/plugin/command_buffer_stub.cc b/chrome/plugin/command_buffer_stub.cc
index 5818414..de9bbdb 100644
--- a/chrome/plugin/command_buffer_stub.cc
+++ b/chrome/plugin/command_buffer_stub.cc
@@ -27,7 +27,8 @@ CommandBufferStub::~CommandBufferStub() {
channel_->RemoveRoute(route_id_);
}
-void CommandBufferStub::OnMessageReceived(const IPC::Message& message) {
+bool CommandBufferStub::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(CommandBufferStub, message)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Initialize, OnInitialize);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_GetState, OnGetState);
@@ -43,8 +44,10 @@ void CommandBufferStub::OnMessageReceived(const IPC::Message& message) {
#if defined(OS_MACOSX)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetWindowSize, OnSetWindowSize);
#endif
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
void CommandBufferStub::OnChannelError() {
diff --git a/chrome/plugin/command_buffer_stub.h b/chrome/plugin/command_buffer_stub.h
index 7519659..e9f65c6 100644
--- a/chrome/plugin/command_buffer_stub.h
+++ b/chrome/plugin/command_buffer_stub.h
@@ -31,7 +31,7 @@ class CommandBufferStub : public IPC::Channel::Listener,
virtual ~CommandBufferStub();
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();
// IPC::Message::Sender implementation:
diff --git a/chrome/plugin/npobject_proxy.cc b/chrome/plugin/npobject_proxy.cc
index 0b7ff45..8a429fb 100644
--- a/chrome/plugin/npobject_proxy.cc
+++ b/chrome/plugin/npobject_proxy.cc
@@ -104,8 +104,9 @@ void NPObjectProxy::NPDeallocate(NPObject* npObj) {
delete obj;
}
-void NPObjectProxy::OnMessageReceived(const IPC::Message& msg) {
+bool NPObjectProxy::OnMessageReceived(const IPC::Message& msg) {
NOTREACHED();
+ return false;
}
void NPObjectProxy::OnChannelError() {
diff --git a/chrome/plugin/npobject_proxy.h b/chrome/plugin/npobject_proxy.h
index 6b6e7ff..4b6b595 100644
--- a/chrome/plugin/npobject_proxy.h
+++ b/chrome/plugin/npobject_proxy.h
@@ -102,7 +102,7 @@ class NPObjectProxy : public IPC::Channel::Listener,
const GURL& page_url);
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
static NPObject* NPAllocate(NPP, NPClass*);
diff --git a/chrome/plugin/npobject_stub.cc b/chrome/plugin/npobject_stub.cc
index e0a8436..7fd18dd 100644
--- a/chrome/plugin/npobject_stub.cc
+++ b/chrome/plugin/npobject_stub.cc
@@ -62,7 +62,7 @@ IPC::Channel::Listener* NPObjectStub::GetChannelListener() {
return static_cast<IPC::Channel::Listener*>(this);
}
-void NPObjectStub::OnMessageReceived(const IPC::Message& msg) {
+bool NPObjectStub::OnMessageReceived(const IPC::Message& msg) {
child_process_logging::SetActiveURL(page_url_);
if (!npobject_) {
@@ -74,9 +74,10 @@ void NPObjectStub::OnMessageReceived(const IPC::Message& msg) {
Send(reply);
}
- return;
+ return true;
}
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NPObjectStub, msg)
IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Release, OnRelease);
IPC_MESSAGE_HANDLER(NPObjectMsg_HasMethod, OnHasMethod);
@@ -89,8 +90,10 @@ void NPObjectStub::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(NPObjectMsg_Enumeration, OnEnumeration);
IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Construct, OnConstruct);
IPC_MESSAGE_HANDLER_DELAY_REPLY(NPObjectMsg_Evaluate, OnEvaluate);
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
void NPObjectStub::OnChannelError() {
diff --git a/chrome/plugin/npobject_stub.h b/chrome/plugin/npobject_stub.h
index 248d001..d43fbad 100644
--- a/chrome/plugin/npobject_stub.h
+++ b/chrome/plugin/npobject_stub.h
@@ -53,7 +53,7 @@ class NPObjectStub : public IPC::Channel::Listener,
private:
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();
// message handlers
diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc
index bc5e61e..fc789353 100644
--- a/chrome/plugin/plugin_channel.cc
+++ b/chrome/plugin/plugin_channel.cc
@@ -190,23 +190,26 @@ bool PluginChannel::Send(IPC::Message* msg) {
return result;
}
-void PluginChannel::OnMessageReceived(const IPC::Message& msg) {
+bool PluginChannel::OnMessageReceived(const IPC::Message& msg) {
if (log_messages_) {
VLOG(1) << "received message @" << &msg << " on channel @" << this
<< " with type " << msg.type();
}
- PluginChannelBase::OnMessageReceived(msg);
+ return PluginChannelBase::OnMessageReceived(msg);
}
-void PluginChannel::OnControlMessageReceived(const IPC::Message& msg) {
+bool PluginChannel::OnControlMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PluginChannel, msg)
IPC_MESSAGE_HANDLER(PluginMsg_CreateInstance, OnCreateInstance)
IPC_MESSAGE_HANDLER_DELAY_REPLY(PluginMsg_DestroyInstance,
OnDestroyInstance)
IPC_MESSAGE_HANDLER(PluginMsg_GenerateRouteID, OnGenerateRouteID)
IPC_MESSAGE_HANDLER(PluginMsg_ClearSiteData, OnClearSiteData)
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
void PluginChannel::OnCreateInstance(const std::string& mime_type,
diff --git a/chrome/plugin/plugin_channel.h b/chrome/plugin/plugin_channel.h
index 519e03c..102d4d6 100644
--- a/chrome/plugin/plugin_channel.h
+++ b/chrome/plugin/plugin_channel.h
@@ -33,7 +33,7 @@ class PluginChannel : public PluginChannelBase {
virtual ~PluginChannel();
virtual bool Send(IPC::Message* msg);
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
base::ProcessHandle renderer_handle() const { return renderer_handle_; }
int renderer_id() { return renderer_id_; }
@@ -69,7 +69,7 @@ class PluginChannel : public PluginChannelBase {
// Called on the plugin thread
PluginChannel();
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
static PluginChannelBase* ClassFactory() { return new PluginChannel(); }
diff --git a/chrome/plugin/plugin_channel_base.cc b/chrome/plugin/plugin_channel_base.cc
index 37bc1c4..e251e9e 100644
--- a/chrome/plugin/plugin_channel_base.cc
+++ b/chrome/plugin/plugin_channel_base.cc
@@ -140,19 +140,20 @@ int PluginChannelBase::Count() {
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 @@ void PluginChannelBase::OnMessageReceived(const IPC::Message& message) {
in_unblock_dispatch_--;
lazy_plugin_channel_stack_.Pointer()->pop();
+ return handled;
}
void PluginChannelBase::OnChannelConnected(int32 peer_pid) {
@@ -228,9 +230,10 @@ void PluginChannelBase::RemoveRoute(int route_id) {
}
}
-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() {
diff --git a/chrome/plugin/plugin_channel_base.h b/chrome/plugin/plugin_channel_base.h
index 22103e8..d1a1a1c 100644
--- a/chrome/plugin/plugin_channel_base.h
+++ b/chrome/plugin/plugin_channel_base.h
@@ -89,10 +89,10 @@ class PluginChannelBase : public IPC::Channel::Listener,
virtual void CleanUp() { }
// Implemented by derived classes to handle control messages
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc
index 8edcbbd..d5757e1 100644
--- a/chrome/plugin/plugin_thread.cc
+++ b/chrome/plugin/plugin_thread.cc
@@ -128,13 +128,16 @@ PluginThread* PluginThread::current() {
return lazy_tls.Pointer()->Get();
}
-void PluginThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool PluginThread::OnControlMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PluginThread, msg)
IPC_MESSAGE_HANDLER(PluginProcessMsg_CreateChannel, OnCreateChannel)
IPC_MESSAGE_HANDLER(PluginProcessMsg_PluginMessage, OnPluginMessage)
IPC_MESSAGE_HANDLER(PluginProcessMsg_NotifyRenderersOfPendingShutdown,
OnNotifyRenderersOfPendingShutdown)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void PluginThread::OnCreateChannel(int renderer_id,
diff --git a/chrome/plugin/plugin_thread.h b/chrome/plugin/plugin_thread.h
index 4d24e3c..f5ef267 100644
--- a/chrome/plugin/plugin_thread.h
+++ b/chrome/plugin/plugin_thread.h
@@ -31,7 +31,7 @@ class PluginThread : public ChildThread {
FilePath plugin_path() { return plugin_path_; }
private:
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
// Callback for when a channel has been created.
void OnCreateChannel(int renderer_id, bool off_the_record);
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 0540adf..41b0256 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -88,7 +88,7 @@ WebPluginDelegateStub::~WebPluginDelegateStub() {
}
}
-void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
+bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
child_process_logging::SetActiveURL(page_url_);
// A plugin can execute a script to delete itself in any of its NPP methods.
@@ -98,6 +98,7 @@ void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
if (!in_destructor_)
AddRef();
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateStub, msg)
IPC_MESSAGE_HANDLER(PluginMsg_Init, OnInit)
IPC_MESSAGE_HANDLER(PluginMsg_WillSendRequest, OnWillSendRequest)
@@ -146,11 +147,14 @@ void WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PluginMsg_SetFakeAcceleratedSurfaceWindowHandle,
OnSetFakeAcceleratedSurfaceWindowHandle)
#endif
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
if (!in_destructor_)
Release();
+
+ DCHECK(handled);
+ return handled;
}
bool WebPluginDelegateStub::Send(IPC::Message* msg) {
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index c310467..0a95587 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -45,7 +45,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
PluginChannel* channel);
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
// IPC::Message::Sender implementation:
virtual bool Send(IPC::Message* msg);
diff --git a/chrome/ppapi_plugin/ppapi_thread.cc b/chrome/ppapi_plugin/ppapi_thread.cc
index be6075d..0fc5ace 100644
--- a/chrome/ppapi_plugin/ppapi_thread.cc
+++ b/chrome/ppapi_plugin/ppapi_thread.cc
@@ -35,7 +35,7 @@ PpapiThread::~PpapiThread() {
// Note that this function is called only for messages from the channel to the
// browser process. Messages from the renderer process are sent via a different
// channel that ends up at Dispatcher::OnMessageReceived.
-void PpapiThread::OnMessageReceived(const IPC::Message& msg) {
+bool PpapiThread::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(PpapiThread, msg)
IPC_MESSAGE_HANDLER(PpapiMsg_LoadPlugin, OnMsgLoadPlugin)
@@ -45,6 +45,7 @@ void PpapiThread::OnMessageReceived(const IPC::Message& msg) {
dispatcher_->OnMessageReceived(msg)
)*/
IPC_END_MESSAGE_MAP()
+ return true;
}
void PpapiThread::OnMsgLoadPlugin(base::ProcessHandle host_process_handle,
diff --git a/chrome/ppapi_plugin/ppapi_thread.h b/chrome/ppapi_plugin/ppapi_thread.h
index 215d1bd..08e62fc 100644
--- a/chrome/ppapi_plugin/ppapi_thread.h
+++ b/chrome/ppapi_plugin/ppapi_thread.h
@@ -32,7 +32,7 @@ class PpapiThread : public ChildThread {
private:
// ChildThread overrides.
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
// Message handlers.
void OnMsgLoadPlugin(base::ProcessHandle renderer_handle,
diff --git a/chrome/profile_import/profile_import_thread.cc b/chrome/profile_import/profile_import_thread.cc
index 2368573..f7a665b 100644
--- a/chrome/profile_import/profile_import_thread.cc
+++ b/chrome/profile_import/profile_import_thread.cc
@@ -34,7 +34,8 @@ ProfileImportThread::ProfileImportThread()
ProfileImportThread::~ProfileImportThread() {}
-void ProfileImportThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool ProfileImportThread::OnControlMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ProfileImportThread, msg)
IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_StartImport,
OnImportStart)
@@ -42,7 +43,9 @@ void ProfileImportThread::OnControlMessageReceived(const IPC::Message& msg) {
OnImportCancel)
IPC_MESSAGE_HANDLER(ProfileImportProcessMsg_ReportImportItemFinished,
OnImportItemFinished)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void ProfileImportThread::OnImportStart(
diff --git a/chrome/profile_import/profile_import_thread.h b/chrome/profile_import/profile_import_thread.h
index 079fa4c..0c86885 100644
--- a/chrome/profile_import/profile_import_thread.h
+++ b/chrome/profile_import/profile_import_thread.h
@@ -56,7 +56,7 @@ class ProfileImportThread : public ChildThread {
private:
// IPC messages
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
// Creates the importer and launches it in a new thread. Import is run on
// a separate thread so that this thread can receive messages from the
diff --git a/chrome/renderer/command_buffer_proxy.cc b/chrome/renderer/command_buffer_proxy.cc
index 0cc1e6a..21eee90 100644
--- a/chrome/renderer/command_buffer_proxy.cc
+++ b/chrome/renderer/command_buffer_proxy.cc
@@ -34,14 +34,17 @@ CommandBufferProxy::~CommandBufferProxy() {
}
}
-void CommandBufferProxy::OnMessageReceived(const IPC::Message& message) {
+bool CommandBufferProxy::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(CommandBufferProxy, message)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_UpdateState, OnUpdateState);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SwapBuffers, OnSwapBuffers);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_NotifyRepaint,
OnNotifyRepaint);
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
void CommandBufferProxy::OnChannelError() {
diff --git a/chrome/renderer/command_buffer_proxy.h b/chrome/renderer/command_buffer_proxy.h
index 245c0580..6f3688f 100644
--- a/chrome/renderer/command_buffer_proxy.h
+++ b/chrome/renderer/command_buffer_proxy.h
@@ -38,7 +38,7 @@ class CommandBufferProxy : public gpu::CommandBuffer,
virtual ~CommandBufferProxy();
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();
int route_id() const { return route_id_; }
diff --git a/chrome/renderer/device_orientation_dispatcher.h b/chrome/renderer/device_orientation_dispatcher.h
index e2abf37..88c1ef5 100644
--- a/chrome/renderer/device_orientation_dispatcher.h
+++ b/chrome/renderer/device_orientation_dispatcher.h
@@ -8,18 +8,20 @@
#include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClient.h"
#include "base/scoped_ptr.h"
+#include "ipc/ipc_channel.h"
class RenderView;
-namespace IPC { class Message; }
namespace WebKit { class WebDeviceOrientation; }
struct ViewMsg_DeviceOrientationUpdated_Params;
-class DeviceOrientationDispatcher : public WebKit::WebDeviceOrientationClient {
+class DeviceOrientationDispatcher : public WebKit::WebDeviceOrientationClient,
+ public IPC::Channel::Listener {
public:
explicit DeviceOrientationDispatcher(RenderView* render_view);
virtual ~DeviceOrientationDispatcher();
+ // IPC::Channel::Implementation.
bool OnMessageReceived(const IPC::Message& msg);
// From WebKit::WebDeviceOrientationClient.
diff --git a/chrome/renderer/devtools_agent.h b/chrome/renderer/devtools_agent.h
index ebb06dd..14a7247 100644
--- a/chrome/renderer/devtools_agent.h
+++ b/chrome/renderer/devtools_agent.h
@@ -11,12 +11,9 @@
#include "base/basictypes.h"
#include "chrome/common/devtools_messages.h"
+#include "ipc/ipc_channel.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgentClient.h"
-namespace IPC {
-class Message;
-}
-
namespace WebKit {
class WebDevToolsAgent;
}
@@ -28,14 +25,15 @@ struct DevToolsMessageData;
// agents with the communication capabilities. All messages from/to Glue's
// agents infrastructure are flowing through this comminucation agent.
// There is a corresponding DevToolsClient object on the client side.
-class DevToolsAgent : public WebKit::WebDevToolsAgentClient {
+class DevToolsAgent : public WebKit::WebDevToolsAgentClient,
+ public IPC::Channel::Listener {
public:
DevToolsAgent(int routing_id, RenderView* view);
virtual ~DevToolsAgent();
void OnNavigate();
- // IPC message interceptor. Called on the Render thread.
+ // IPC::Channel::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& message);
// WebDevToolsAgentClient implementation
diff --git a/chrome/renderer/devtools_client.h b/chrome/renderer/devtools_client.h
index 577e189..463dc35 100644
--- a/chrome/renderer/devtools_client.h
+++ b/chrome/renderer/devtools_client.h
@@ -10,11 +10,9 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
+#include "ipc/ipc_channel.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsFrontendClient.h"
-namespace IPC {
-class Message;
-}
class MessageLoop;
class RenderView;
@@ -31,13 +29,13 @@ struct DevToolsMessageData;
// corresponding DevToolsAgent object.
// TODO(yurys): now the client is almost empty later it will delegate calls to
// code in glue
-class DevToolsClient : public WebKit::WebDevToolsFrontendClient {
+class DevToolsClient : public WebKit::WebDevToolsFrontendClient,
+ public IPC::Channel::Listener {
public:
explicit DevToolsClient(RenderView* view);
virtual ~DevToolsClient();
- // Called to possibly handle the incoming IPC message. Returns true if
- // handled. Called in render thread.
+ // IPC::Channel::Listener implementation.
bool OnMessageReceived(const IPC::Message& message);
// WebDevToolsFrontendClient implementation
diff --git a/chrome/renderer/geolocation_dispatcher_old.h b/chrome/renderer/geolocation_dispatcher_old.h
index 51567ef..ab93c14 100644
--- a/chrome/renderer/geolocation_dispatcher_old.h
+++ b/chrome/renderer/geolocation_dispatcher_old.h
@@ -12,7 +12,7 @@
#include "base/basictypes.h"
#include "base/id_map.h"
-#include "ipc/ipc_message.h"
+#include "ipc/ipc_channel.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationService.h"
@@ -25,13 +25,13 @@ struct Geoposition;
// It's the complement of GeolocationDispatcherHostOld (owned by
// RenderViewHost).
-class GeolocationDispatcherOld : public WebKit::WebGeolocationService {
+class GeolocationDispatcherOld : public WebKit::WebGeolocationService,
+ public IPC::Channel::Listener {
public:
explicit GeolocationDispatcherOld(RenderView* render_view);
virtual ~GeolocationDispatcherOld();
- // Called to possibly handle the incoming IPC message. Returns true if
- // handled. Called in render thread.
+ // IPC::Channel::Listener implementation
bool OnMessageReceived(const IPC::Message& msg);
// WebKit::WebGeolocationService.
diff --git a/chrome/renderer/gpu_channel_host.cc b/chrome/renderer/gpu_channel_host.cc
index 80baea9..ecf7bfc 100644
--- a/chrome/renderer/gpu_channel_host.cc
+++ b/chrome/renderer/gpu_channel_host.cc
@@ -37,14 +37,14 @@ const GPUInfo& GpuChannelHost::gpu_info() const {
return gpu_info_;
}
-void GpuChannelHost::OnMessageReceived(const IPC::Message& message) {
+bool GpuChannelHost::OnMessageReceived(const IPC::Message& message) {
DCHECK(message.routing_id() != MSG_ROUTING_CONTROL);
// The object to which the message is addressed might have been destroyed.
// This is expected, for example an asynchronous SwapBuffers notification
// to a command buffer proxy that has since been destroyed. This function
// fails silently in that case.
- router_.RouteMessage(message);
+ return router_.RouteMessage(message);
}
void GpuChannelHost::OnChannelConnected(int32 peer_pid) {
diff --git a/chrome/renderer/gpu_channel_host.h b/chrome/renderer/gpu_channel_host.h
index 8d9c684..42eebba 100644
--- a/chrome/renderer/gpu_channel_host.h
+++ b/chrome/renderer/gpu_channel_host.h
@@ -53,7 +53,7 @@ class GpuChannelHost : public IPC::Channel::Listener,
const GPUInfo& gpu_info() const;
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
diff --git a/chrome/renderer/gpu_video_decoder_host.cc b/chrome/renderer/gpu_video_decoder_host.cc
index 44599f3..9d9ba04 100644
--- a/chrome/renderer/gpu_video_decoder_host.cc
+++ b/chrome/renderer/gpu_video_decoder_host.cc
@@ -32,7 +32,8 @@ void GpuVideoDecoderHost::OnChannelError() {
ipc_sender_ = NULL;
}
-void GpuVideoDecoderHost::OnMessageReceived(const IPC::Message& msg) {
+bool GpuVideoDecoderHost::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(GpuVideoDecoderHost, msg)
IPC_MESSAGE_HANDLER(GpuVideoDecoderHostMsg_CreateVideoDecoderDone,
OnCreateVideoDecoderDone)
@@ -54,8 +55,10 @@ void GpuVideoDecoderHost::OnMessageReceived(const IPC::Message& msg) {
OnAllocateVideoFrames)
IPC_MESSAGE_HANDLER(GpuVideoDecoderHostMsg_ReleaseAllVideoFrames,
OnReleaseAllVideoFrames)
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
void GpuVideoDecoderHost::Initialize(
diff --git a/chrome/renderer/gpu_video_decoder_host.h b/chrome/renderer/gpu_video_decoder_host.h
index c32a9f0..a7a3a71 100644
--- a/chrome/renderer/gpu_video_decoder_host.h
+++ b/chrome/renderer/gpu_video_decoder_host.h
@@ -50,7 +50,7 @@ class GpuVideoDecoderHost : public media::VideoDecodeEngine,
// IPC::Channel::Listener.
virtual void OnChannelConnected(int32 peer_pid) {}
virtual void OnChannelError();
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// media::VideoDecodeEngine implementation.
virtual void Initialize(MessageLoop* message_loop,
diff --git a/chrome/renderer/indexed_db_dispatcher.h b/chrome/renderer/indexed_db_dispatcher.h
index 1210551..8012015 100644
--- a/chrome/renderer/indexed_db_dispatcher.h
+++ b/chrome/renderer/indexed_db_dispatcher.h
@@ -8,7 +8,7 @@
#include "base/id_map.h"
#include "base/nullable_string16.h"
-#include "ipc/ipc_message.h"
+#include "ipc/ipc_channel.h"
#include "third_party/WebKit/WebKit/chromium/public/WebExceptionCode.h"
#include "third_party/WebKit/WebKit/chromium/public/WebIDBCallbacks.h"
#include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabase.h"
@@ -24,13 +24,12 @@ class WebIDBTransaction;
}
// Handle the indexed db related communication for this entire renderer.
-class IndexedDBDispatcher {
+class IndexedDBDispatcher : public IPC::Channel::Listener {
public:
IndexedDBDispatcher();
~IndexedDBDispatcher();
- // Called to possibly handle the incoming IPC message. Returns true if
- // handled.
+ // IPC::Channel::Listener implementation.
bool OnMessageReceived(const IPC::Message& msg);
void RequestIDBFactoryOpen(
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc
index c188f34..1d98d6e 100644
--- a/chrome/renderer/mock_render_thread.cc
+++ b/chrome/renderer/mock_render_thread.cc
@@ -81,7 +81,7 @@ void MockRenderThread::SendCloseMessage() {
widget_->OnMessageReceived(msg);
}
-void MockRenderThread::OnMessageReceived(const IPC::Message& msg) {
+bool MockRenderThread::OnMessageReceived(const IPC::Message& msg) {
// Save the message in the sink.
sink_.OnMessageReceived(msg);
@@ -116,6 +116,7 @@ void MockRenderThread::OnMessageReceived(const IPC::Message& msg) {
#endif
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
+ return handled;
}
// The Widget expects to be returned valid route_id.
diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h
index a1b58a5..2a6dc60 100644
--- a/chrome/renderer/mock_render_thread.h
+++ b/chrome/renderer/mock_render_thread.h
@@ -82,7 +82,7 @@ class MockRenderThread : public RenderThreadBase {
private:
// This function operates as a regular IPC listener.
- void OnMessageReceived(const IPC::Message& msg);
+ bool OnMessageReceived(const IPC::Message& msg);
// The Widget expects to be returned valid route_id.
void OnMsgCreateWidget(int opener_id,
diff --git a/chrome/renderer/notification_provider.h b/chrome/renderer/notification_provider.h
index ccd6cf3..1ba84b2 100644
--- a/chrome/renderer/notification_provider.h
+++ b/chrome/renderer/notification_provider.h
@@ -18,7 +18,8 @@ class WebNotificationPermissionCallback;
// NotificationProvider class is owned by the RenderView. Only
// to be used on the UI thread.
-class NotificationProvider : public WebKit::WebNotificationPresenter {
+class NotificationProvider : public WebKit::WebNotificationPresenter,
+ public IPC::Channel::Listener {
public:
explicit NotificationProvider(RenderView* view);
virtual ~NotificationProvider();
@@ -32,7 +33,7 @@ class NotificationProvider : public WebKit::WebNotificationPresenter {
virtual void requestPermission(const WebKit::WebSecurityOrigin& origin,
WebKit::WebNotificationPermissionCallback* callback);
- // IPC message handler called from RenderView.
+ // IPC::Channel::Listener implementation.
bool OnMessageReceived(const IPC::Message& message);
// Called when the RenderView navigates.
diff --git a/chrome/renderer/plugin_channel_host.cc b/chrome/renderer/plugin_channel_host.cc
index b6a93c0..34d1461 100644
--- a/chrome/renderer/plugin_channel_host.cc
+++ b/chrome/renderer/plugin_channel_host.cc
@@ -114,12 +114,15 @@ void PluginChannelHost::RemoveRoute(int route_id) {
PluginChannelBase::RemoveRoute(route_id);
}
-void PluginChannelHost::OnControlMessageReceived(const IPC::Message& message) {
+bool PluginChannelHost::OnControlMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PluginChannelHost, message)
IPC_MESSAGE_HANDLER(PluginHostMsg_SetException, OnSetException)
IPC_MESSAGE_HANDLER(PluginHostMsg_PluginShuttingDown, OnPluginShuttingDown)
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
void PluginChannelHost::OnSetException(const std::string& message) {
diff --git a/chrome/renderer/plugin_channel_host.h b/chrome/renderer/plugin_channel_host.h
index 241833f..5f6d556 100644
--- a/chrome/renderer/plugin_channel_host.h
+++ b/chrome/renderer/plugin_channel_host.h
@@ -48,7 +48,7 @@ class PluginChannelHost : public PluginChannelBase {
static PluginChannelBase* ClassFactory() { return new PluginChannelHost(); }
- virtual void OnControlMessageReceived(const IPC::Message& message);
+ virtual bool OnControlMessageReceived(const IPC::Message& message);
void OnSetException(const std::string& message);
void OnPluginShuttingDown(const IPC::Message& message);
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 5fc265e..f1f1008 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -593,13 +593,14 @@ void RenderThread::OnDOMStorageEvent(
params.storage_type == DOM_STORAGE_LOCAL);
}
-void RenderThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool RenderThread::OnControlMessageReceived(const IPC::Message& msg) {
// Some messages are handled by delegates.
if (appcache_dispatcher_->OnMessageReceived(msg))
- return;
+ return true;
if (indexed_db_dispatcher_->OnMessageReceived(msg))
- return;
+ return true;
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderThread, msg)
IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks)
IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_Add, OnAddVisitedLinks)
@@ -660,7 +661,9 @@ void RenderThread::OnControlMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewMsg_SetPhishingModel, OnSetPhishingModel)
IPC_MESSAGE_HANDLER(ViewMsg_SpeechInput_SetFeatureEnabled,
OnSetSpeechInputEnabled)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void RenderThread::OnSetSpeechInputEnabled(bool enabled) {
diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h
index 6946a47..6817cfb 100644
--- a/chrome/renderer/render_thread.h
+++ b/chrome/renderer/render_thread.h
@@ -254,7 +254,7 @@ class RenderThread : public RenderThreadBase,
int extension_group);
private:
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
void Init();
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 7a84c11..1a9aef5 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -944,31 +944,32 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd,
render_thread_->AddFilter(audio_message_filter_);
}
-void RenderView::OnMessageReceived(const IPC::Message& message) {
+bool RenderView::OnMessageReceived(const IPC::Message& message) {
WebFrame* main_frame = webview() ? webview()->mainFrame() : NULL;
if (main_frame)
child_process_logging::SetActiveURL(main_frame->url());
// If this is developer tools renderer intercept tools messages first.
if (devtools_client_.get() && devtools_client_->OnMessageReceived(message))
- return;
+ return true;
if (devtools_agent_.get() && devtools_agent_->OnMessageReceived(message))
- return;
+ return true;
if (notification_provider_->OnMessageReceived(message))
- return;
+ return true;
if (geolocation_dispatcher_.get() &&
geolocation_dispatcher_->OnMessageReceived(message)) {
- return;
+ return true;
}
if (speech_input_dispatcher_.get() &&
speech_input_dispatcher_->OnMessageReceived(message)) {
- return;
+ return true;
}
if (device_orientation_dispatcher_.get() &&
device_orientation_dispatcher_->OnMessageReceived(message)) {
- return;
+ return true;
}
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(RenderView, message)
IPC_MESSAGE_HANDLER(ViewMsg_CaptureThumbnail, OnCaptureThumbnail)
IPC_MESSAGE_HANDLER(ViewMsg_CaptureSnapshot, OnCaptureSnapshot)
@@ -1102,8 +1103,9 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ViewMsg_PrintPreview, OnPrintPreview)
// Have the super handle all other messages.
- IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message))
+ IPC_MESSAGE_UNHANDLED(handled = RenderWidget::OnMessageReceived(message))
IPC_END_MESSAGE_MAP()
+ return handled;
}
void RenderView::OnCaptureThumbnail() {
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 1f97fa6..862ed6c 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -388,7 +388,7 @@ class RenderView : public RenderWidget,
// IPC::Channel::Listener implementation -------------------------------------
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
// WebKit::WebWidgetClient implementation ------------------------------------
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 9cf323c..2f14576 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -153,25 +153,29 @@ void RenderWidget::CompleteInit(gfx::NativeViewId parent_hwnd) {
Send(new ViewHostMsg_RenderViewReady(routing_id_));
}
-IPC_DEFINE_MESSAGE_MAP(RenderWidget)
- IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose)
- IPC_MESSAGE_HANDLER(ViewMsg_CreatingNew_ACK, OnCreatingNewAck)
- IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize)
- IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden)
- IPC_MESSAGE_HANDLER(ViewMsg_WasRestored, OnWasRestored)
- IPC_MESSAGE_HANDLER(ViewMsg_UpdateRect_ACK, OnUpdateRectAck)
- IPC_MESSAGE_HANDLER(ViewMsg_HandleInputEvent, OnHandleInputEvent)
- IPC_MESSAGE_HANDLER(ViewMsg_MouseCaptureLost, OnMouseCaptureLost)
- IPC_MESSAGE_HANDLER(ViewMsg_SetFocus, OnSetFocus)
- IPC_MESSAGE_HANDLER(ViewMsg_SetInputMethodActive, OnSetInputMethodActive)
- IPC_MESSAGE_HANDLER(ViewMsg_ImeSetComposition, OnImeSetComposition)
- IPC_MESSAGE_HANDLER(ViewMsg_ImeConfirmComposition, OnImeConfirmComposition)
- IPC_MESSAGE_HANDLER(ViewMsg_PaintAtSize, OnMsgPaintAtSize)
- IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnMsgRepaint)
- IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection)
- IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck)
- IPC_MESSAGE_UNHANDLED_ERROR()
-IPC_END_MESSAGE_MAP()
+bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(RenderWidget, message)
+ IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose)
+ IPC_MESSAGE_HANDLER(ViewMsg_CreatingNew_ACK, OnCreatingNewAck)
+ IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize)
+ IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden)
+ IPC_MESSAGE_HANDLER(ViewMsg_WasRestored, OnWasRestored)
+ IPC_MESSAGE_HANDLER(ViewMsg_UpdateRect_ACK, OnUpdateRectAck)
+ IPC_MESSAGE_HANDLER(ViewMsg_HandleInputEvent, OnHandleInputEvent)
+ IPC_MESSAGE_HANDLER(ViewMsg_MouseCaptureLost, OnMouseCaptureLost)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetFocus, OnSetFocus)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetInputMethodActive, OnSetInputMethodActive)
+ IPC_MESSAGE_HANDLER(ViewMsg_ImeSetComposition, OnImeSetComposition)
+ IPC_MESSAGE_HANDLER(ViewMsg_ImeConfirmComposition, OnImeConfirmComposition)
+ IPC_MESSAGE_HANDLER(ViewMsg_PaintAtSize, OnMsgPaintAtSize)
+ IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnMsgRepaint)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection)
+ IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
bool RenderWidget::Send(IPC::Message* message) {
// Don't send any messages after the browser has told us to close.
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index bf542bf..f847ce2 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -92,7 +92,7 @@ class RenderWidget : public IPC::Channel::Listener,
bool has_focus() const { return has_focus_; }
// IPC::Channel::Listener
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
// IPC::Message::Sender
virtual bool Send(IPC::Message* msg);
diff --git a/chrome/renderer/renderer_main_unittest.cc b/chrome/renderer/renderer_main_unittest.cc
index 464419b..653e02f 100644
--- a/chrome/renderer/renderer_main_unittest.cc
+++ b/chrome/renderer/renderer_main_unittest.cc
@@ -89,9 +89,10 @@ class SuicidalListener : public IPC::Channel::Listener {
MessageLoop::current()->Quit();
}
- void OnMessageReceived(const IPC::Message& message) {
+ bool OnMessageReceived(const IPC::Message& message) {
// We shouldn't receive any messages
- ASSERT_TRUE(false);
+ NOTREACHED();
+ return false;
}
};
diff --git a/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc b/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
index f84b0bd..edb5394 100644
--- a/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
+++ b/chrome/renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc
@@ -59,13 +59,15 @@ class MockScorer : public Scorer {
class PhishingClassifierDelegateTest : public RenderViewFakeResourcesTest {
protected:
- void OnMessageReceived(const IPC::Message& message) {
+ bool OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PhishingClassifierDelegateTest, message)
IPC_MESSAGE_HANDLER(ViewHostMsg_DetectedPhishingSite,
OnDetectedPhishingSite)
IPC_MESSAGE_UNHANDLED(
- RenderViewFakeResourcesTest::OnMessageReceived(message))
+ handled = RenderViewFakeResourcesTest::OnMessageReceived(message))
IPC_END_MESSAGE_MAP()
+ return handled;
}
void OnDetectedPhishingSite(GURL phishing_url,
diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
index e745373..bc52ef2 100644
--- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
+++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
@@ -36,13 +36,14 @@ const int32 RenderViewFakeResourcesTest::kViewId = 5;
RenderViewFakeResourcesTest::RenderViewFakeResourcesTest() {}
RenderViewFakeResourcesTest::~RenderViewFakeResourcesTest() {}
-void RenderViewFakeResourcesTest::OnMessageReceived(
+bool RenderViewFakeResourcesTest::OnMessageReceived(
const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(RenderViewFakeResourcesTest, message)
IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopLoading, OnDidStopLoading)
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestResource, OnRequestResource)
IPC_END_MESSAGE_MAP()
+ return true;
}
bool RenderViewFakeResourcesTest::Visit(RenderView* render_view) {
diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.h b/chrome/renderer/safe_browsing/render_view_fake_resources_test.h
index 953b0cb..a92fb28 100644
--- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.h
+++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.h
@@ -71,7 +71,7 @@ class RenderViewFakeResourcesTest : public ::testing::Test,
public RenderViewVisitor {
public:
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// RenderViewVisitor implementation.
virtual bool Visit(RenderView* render_view);
diff --git a/chrome/renderer/speech_input_dispatcher.h b/chrome/renderer/speech_input_dispatcher.h
index 09133d2..e993226 100644
--- a/chrome/renderer/speech_input_dispatcher.h
+++ b/chrome/renderer/speech_input_dispatcher.h
@@ -7,7 +7,7 @@
#include "base/basictypes.h"
#include "chrome/common/speech_input_result.h"
-#include "ipc/ipc_message.h"
+#include "ipc/ipc_channel.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputController.h"
class GURL;
@@ -21,13 +21,13 @@ struct WebRect;
// SpeechInputDispatcher is a delegate for speech input messages used by WebKit.
// It's the complement of SpeechInputDispatcherHost (owned by RenderViewHost).
-class SpeechInputDispatcher : public WebKit::WebSpeechInputController {
+class SpeechInputDispatcher : public WebKit::WebSpeechInputController,
+ public IPC::Channel::Listener {
public:
SpeechInputDispatcher(RenderView* render_view,
WebKit::WebSpeechInputListener* listener);
- // Called to possibly handle the incoming IPC message. Returns true if
- // handled. Called in render thread.
+ // IPC::Channel::Listener implementation.
bool OnMessageReceived(const IPC::Message& msg);
// WebKit::WebSpeechInputController.
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 1b2e7d7..e76977f 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -424,9 +424,10 @@ void WebPluginDelegateProxy::InstallMissingPlugin() {
Send(new PluginMsg_InstallMissingPlugin(instance_id_));
}
-void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) {
+bool WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) {
child_process_logging::SetActiveURL(page_url_);
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebPluginDelegateProxy, msg)
IPC_MESSAGE_HANDLER(PluginHostMsg_SetWindow, OnSetWindow)
#if defined(OS_WIN)
@@ -478,9 +479,10 @@ void WebPluginDelegateProxy::OnMessageReceived(const IPC::Message& msg) {
#endif
IPC_MESSAGE_HANDLER(PluginHostMsg_URLRedirectResponse,
OnURLRedirectResponse)
-
- IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+ return handled;
}
void WebPluginDelegateProxy::OnChannelError() {
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index 30e212e..49bcc70 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -95,7 +95,7 @@ class WebPluginDelegateProxy
#endif
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
// IPC::Message::Sender implementation:
diff --git a/chrome/renderer/websharedworker_proxy.cc b/chrome/renderer/websharedworker_proxy.cc
index 8c79cb8..84043d8 100644
--- a/chrome/renderer/websharedworker_proxy.cc
+++ b/chrome/renderer/websharedworker_proxy.cc
@@ -67,10 +67,13 @@ void WebSharedWorkerProxy::connect(WebKit::WebMessagePortChannel* channel,
}
}
-void WebSharedWorkerProxy::OnMessageReceived(const IPC::Message& message) {
+bool WebSharedWorkerProxy::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebSharedWorkerProxy, message)
IPC_MESSAGE_HANDLER(ViewMsg_WorkerCreated, OnWorkerCreated)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void WebSharedWorkerProxy::OnWorkerCreated() {
diff --git a/chrome/renderer/websharedworker_proxy.h b/chrome/renderer/websharedworker_proxy.h
index 78b1167..d818264 100644
--- a/chrome/renderer/websharedworker_proxy.h
+++ b/chrome/renderer/websharedworker_proxy.h
@@ -41,7 +41,7 @@ class WebSharedWorkerProxy : public WebKit::WebSharedWorker,
virtual void clientDestroyed();
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
private:
void OnWorkerCreated();
diff --git a/chrome/renderer/webworker_proxy.cc b/chrome/renderer/webworker_proxy.cc
index abbb51f..3ae1749 100644
--- a/chrome/renderer/webworker_proxy.cc
+++ b/chrome/renderer/webworker_proxy.cc
@@ -84,10 +84,11 @@ void WebWorkerProxy::workerObjectDestroyed() {
void WebWorkerProxy::clientDestroyed() {
}
-void WebWorkerProxy::OnMessageReceived(const IPC::Message& message) {
+bool WebWorkerProxy::OnMessageReceived(const IPC::Message& message) {
if (!client_)
- return;
+ return false;
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebWorkerProxy, message)
IPC_MESSAGE_HANDLER(ViewMsg_WorkerCreated, OnWorkerCreated)
IPC_MESSAGE_HANDLER(WorkerMsg_PostMessage, OnPostMessage)
@@ -105,7 +106,9 @@ void WebWorkerProxy::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_FORWARD(WorkerHostMsg_WorkerContextDestroyed,
static_cast<WebCommonWorkerClient*>(client_),
WebCommonWorkerClient::workerContextDestroyed)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void WebWorkerProxy::OnWorkerCreated() {
diff --git a/chrome/renderer/webworker_proxy.h b/chrome/renderer/webworker_proxy.h
index 556f3dc..4b51b4f 100644
--- a/chrome/renderer/webworker_proxy.h
+++ b/chrome/renderer/webworker_proxy.h
@@ -43,7 +43,7 @@ class WebWorkerProxy : public WebKit::WebWorker, private WebWorkerBase {
virtual void clientDestroyed();
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
private:
void CancelCreation();
diff --git a/chrome/service/service_ipc_server.cc b/chrome/service/service_ipc_server.cc
index c7280c3..aa4d8ec 100644
--- a/chrome/service/service_ipc_server.cc
+++ b/chrome/service/service_ipc_server.cc
@@ -77,7 +77,8 @@ bool ServiceIPCServer::Send(IPC::Message* msg) {
return channel_->Send(msg);
}
-void ServiceIPCServer::OnMessageReceived(const IPC::Message& msg) {
+bool ServiceIPCServer::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ServiceIPCServer, msg)
IPC_MESSAGE_HANDLER(ServiceMsg_EnableCloudPrintProxy,
OnEnableCloudPrintProxy)
@@ -100,7 +101,9 @@ void ServiceIPCServer::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ServiceMsg_Hello, OnHello);
IPC_MESSAGE_HANDLER(ServiceMsg_Shutdown, OnShutdown);
IPC_MESSAGE_HANDLER(ServiceMsg_UpdateAvailable, OnUpdateAvailable);
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void ServiceIPCServer::OnEnableCloudPrintProxy(const std::string& lsid) {
diff --git a/chrome/service/service_ipc_server.h b/chrome/service/service_ipc_server.h
index af19f7b..bff4f45 100644
--- a/chrome/service/service_ipc_server.h
+++ b/chrome/service/service_ipc_server.h
@@ -35,7 +35,7 @@ class ServiceIPCServer : public IPC::Channel::Listener,
private:
// IPC::Channel::Listener implementation:
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelConnected(int32 peer_pid);
virtual void OnChannelError();
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index d6b4dbe..859e725 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -128,7 +128,7 @@ void ServiceUtilityProcessHost::OnChildDied() {
ServiceChildProcessHost::OnChildDied();
}
-void ServiceUtilityProcessHost::OnMessageReceived(const IPC::Message& message) {
+bool ServiceUtilityProcessHost::OnMessageReceived(const IPC::Message& message) {
bool msg_is_ok = false;
IPC_BEGIN_MESSAGE_MAP_EX(ServiceUtilityProcessHost, message, msg_is_ok)
#if defined(OS_WIN) // This hack is Windows-specific.
@@ -138,6 +138,7 @@ void ServiceUtilityProcessHost::OnMessageReceived(const IPC::Message& message) {
OnRenderPDFPagesToMetafileSucceeded)
IPC_MESSAGE_UNHANDLED(msg_is_ok__ = MessageForClient(message))
IPC_END_MESSAGE_MAP_EX()
+ return true;
}
bool ServiceUtilityProcessHost::MessageForClient(const IPC::Message& message) {
@@ -172,8 +173,9 @@ void ServiceUtilityProcessHost::OnRenderPDFPagesToMetafileSucceeded(
waiting_for_reply_ = false;
}
-void ServiceUtilityProcessHost::Client::OnMessageReceived(
+bool ServiceUtilityProcessHost::Client::OnMessageReceived(
const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ServiceUtilityProcessHost, message)
IPC_MESSAGE_HANDLER(UtilityHostMsg_RenderPDFPagesToMetafile_Failed,
Client::OnRenderPDFPagesToMetafileFailed)
@@ -181,7 +183,9 @@ void ServiceUtilityProcessHost::Client::OnMessageReceived(
Client::OnGetPrinterCapsAndDefaultsSucceeded)
IPC_MESSAGE_HANDLER(UtilityHostMsg_GetPrinterCapsAndDefaults_Failed,
Client::OnGetPrinterCapsAndDefaultsFailed)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
+ return handled;
}
void ServiceUtilityProcessHost::Client::MetafileAvailable(
diff --git a/chrome/service/service_utility_process_host.h b/chrome/service/service_utility_process_host.h
index 54e039c..b770e1a 100644
--- a/chrome/service/service_utility_process_host.h
+++ b/chrome/service/service_utility_process_host.h
@@ -80,7 +80,7 @@ class ServiceUtilityProcessHost : public ServiceChildProcessHost {
friend class base::RefCountedThreadSafe<Client>;
friend class ServiceUtilityProcessHost;
- void OnMessageReceived(const IPC::Message& message);
+ bool OnMessageReceived(const IPC::Message& message);
// Invoked when a metafile file is ready.
void MetafileAvailable(const FilePath& metafile_path,
int highest_rendered_page_number);
@@ -122,7 +122,7 @@ class ServiceUtilityProcessHost : public ServiceChildProcessHost {
bool StartProcess(bool no_sandbox, const FilePath& exposed_dir);
// IPC messages:
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
// Called when at least one page in the specified PDF has been rendered
// successfully into metafile_path_;
void OnRenderPDFPagesToMetafileSucceeded(int highest_rendered_page_number);
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index bf00ea6..cf9391d 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -42,17 +42,16 @@ class AutomationMessageFilter : public IPC::ChannelProxy::MessageFilter {
// the message be handled in the default way.
virtual bool OnMessageReceived(const IPC::Message& message) {
bool handled = true;
-
IPC_BEGIN_MESSAGE_MAP(AutomationMessageFilter, message)
IPC_MESSAGE_HANDLER_GENERIC(AutomationMsg_Hello,
- OnAutomationHello(message));
+ OnAutomationHello(message))
IPC_MESSAGE_HANDLER_GENERIC(
- AutomationMsg_InitialLoadsComplete, server_->SignalInitialLoads());
+ AutomationMsg_InitialLoadsComplete, server_->SignalInitialLoads())
IPC_MESSAGE_HANDLER(AutomationMsg_InitialNewTabUILoadComplete,
- NewTabLoaded);
+ NewTabLoaded)
IPC_MESSAGE_HANDLER_GENERIC(
- AutomationMsg_InvalidateHandle, server_->InvalidateHandle(message));
- IPC_MESSAGE_UNHANDLED(handled = false);
+ AutomationMsg_InvalidateHandle, server_->InvalidateHandle(message))
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -379,10 +378,11 @@ void AutomationProxy::Disconnect() {
channel_.reset();
}
-void AutomationProxy::OnMessageReceived(const IPC::Message& msg) {
+bool AutomationProxy::OnMessageReceived(const IPC::Message& msg) {
// This won't get called unless AutomationProxy is run from
// inside a message loop.
NOTREACHED();
+ return false;
}
void AutomationProxy::OnChannelError() {
diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h
index b0cd74c..ee77016 100644
--- a/chrome/test/automation/automation_proxy.h
+++ b/chrome/test/automation/automation_proxy.h
@@ -70,7 +70,7 @@ class AutomationProxy : public IPC::Channel::Listener,
bool use_named_interface);
// IPC callback
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
// Close the automation IPC channel.
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index 9c36fe1..8568e5e 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -762,7 +762,8 @@ const AutomationURLResponse ExternalTabUITestMockClient::http_200(
"",
0);
-void ExternalTabUITestMockClient::OnMessageReceived(const IPC::Message& msg) {
+bool ExternalTabUITestMockClient::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ExternalTabUITestMockClient, msg)
IPC_MESSAGE_HANDLER(AutomationMsg_DidNavigate, OnDidNavigate)
IPC_MESSAGE_HANDLER(AutomationMsg_ForwardMessageToExternalHost,
@@ -776,7 +777,9 @@ void ExternalTabUITestMockClient::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(AutomationMsg_OpenURL, OnOpenURL)
IPC_MESSAGE_HANDLER(AutomationMsg_NavigationStateChanged,
OnNavigationStateChanged)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
scoped_refptr<TabProxy> ExternalTabUITestMockClient::CreateHostWindowAndTab(
diff --git a/chrome/test/automation/automation_proxy_uitest.h b/chrome/test/automation/automation_proxy_uitest.h
index 35de197..6f87c4e 100644
--- a/chrome/test/automation/automation_proxy_uitest.h
+++ b/chrome/test/automation/automation_proxy_uitest.h
@@ -101,7 +101,7 @@ class ExternalTabUITestMockClient : public AutomationProxy {
gfx::NativeWindow host_window_;
// Simple dispatcher to above OnXXX methods.
- virtual void OnMessageReceived(const IPC::Message& msg);
+ virtual bool OnMessageReceived(const IPC::Message& msg);
virtual void InvalidateHandle(const IPC::Message& message);
};
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index dbf298c..ce7ed16 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -790,10 +790,11 @@ void TabProxy::RemoveObserver(TabProxyDelegate* observer) {
}
// Called on Channel background thread, if TabMessages filter is installed.
-void TabProxy::OnMessageReceived(const IPC::Message& message) {
+bool TabProxy::OnMessageReceived(const IPC::Message& message) {
AutoLock lock(list_lock_);
FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_,
OnMessageReceived(this, message));
+ return true;
}
void TabProxy::OnChannelError() {
diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h
index 8c70abd3..82f65ac 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -405,7 +405,7 @@ class TabProxy : public AutomationResourceProxy,
// Calls delegates
void AddObserver(TabProxyDelegate* observer);
void RemoveObserver(TabProxyDelegate* observer);
- void OnMessageReceived(const IPC::Message& message);
+ bool OnMessageReceived(const IPC::Message& message);
void OnChannelError();
protected:
virtual ~TabProxy();
diff --git a/chrome/utility/utility_thread.cc b/chrome/utility/utility_thread.cc
index baf831f..2349f07 100644
--- a/chrome/utility/utility_thread.cc
+++ b/chrome/utility/utility_thread.cc
@@ -51,7 +51,8 @@ UtilityThread::UtilityThread()
UtilityThread::~UtilityThread() {
}
-void UtilityThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool UtilityThread::OnControlMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(UtilityThread, msg)
IPC_MESSAGE_HANDLER(UtilityMsg_UnpackExtension, OnUnpackExtension)
IPC_MESSAGE_HANDLER(UtilityMsg_UnpackWebResource, OnUnpackWebResource)
@@ -65,7 +66,9 @@ void UtilityThread::OnControlMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(UtilityMsg_BatchMode_Finished, OnBatchModeFinished)
IPC_MESSAGE_HANDLER(UtilityMsg_GetPrinterCapsAndDefaults,
OnGetPrinterCapsAndDefaults)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void UtilityThread::OnUnpackExtension(const FilePath& extension_path) {
diff --git a/chrome/utility/utility_thread.h b/chrome/utility/utility_thread.h
index 187f914..ce4cc25 100644
--- a/chrome/utility/utility_thread.h
+++ b/chrome/utility/utility_thread.h
@@ -38,7 +38,7 @@ class UtilityThread : public ChildThread {
private:
// IPC messages
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
void OnUnpackExtension(const FilePath& extension_path);
// IPC messages for web resource service.
diff --git a/chrome/worker/websharedworker_stub.cc b/chrome/worker/websharedworker_stub.cc
index 8cb167a..0c03ba0 100644
--- a/chrome/worker/websharedworker_stub.cc
+++ b/chrome/worker/websharedworker_stub.cc
@@ -26,13 +26,16 @@ WebSharedWorkerStub::~WebSharedWorkerStub() {
impl_->clientDestroyed();
}
-void WebSharedWorkerStub::OnMessageReceived(const IPC::Message& message) {
+bool WebSharedWorkerStub::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebSharedWorkerStub, message)
IPC_MESSAGE_HANDLER(WorkerMsg_StartWorkerContext, OnStartWorkerContext)
IPC_MESSAGE_HANDLER(WorkerMsg_TerminateWorkerContext,
OnTerminateWorkerContext)
IPC_MESSAGE_HANDLER(WorkerMsg_Connect, OnConnect)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void WebSharedWorkerStub::OnChannelError() {
diff --git a/chrome/worker/websharedworker_stub.h b/chrome/worker/websharedworker_stub.h
index b9cb60c..04f07af 100644
--- a/chrome/worker/websharedworker_stub.h
+++ b/chrome/worker/websharedworker_stub.h
@@ -22,7 +22,7 @@ class WebSharedWorkerStub : public WebWorkerStubBase {
const WorkerAppCacheInitInfo& appcache_init_info);
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();
virtual const GURL& url() const;
diff --git a/chrome/worker/webworker_stub.cc b/chrome/worker/webworker_stub.cc
index cd58cab..a3d3ba4 100644
--- a/chrome/worker/webworker_stub.cc
+++ b/chrome/worker/webworker_stub.cc
@@ -60,10 +60,11 @@ const GURL& WebWorkerStub::url() const {
return url_;
}
-void WebWorkerStub::OnMessageReceived(const IPC::Message& message) {
+bool WebWorkerStub::OnMessageReceived(const IPC::Message& message) {
if (!impl_)
- return;
+ return false;
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebWorkerStub, message)
IPC_MESSAGE_FORWARD(WorkerMsg_StartWorkerContext, impl_,
WebWorker::startWorkerContext)
@@ -72,7 +73,9 @@ void WebWorkerStub::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(WorkerMsg_PostMessage, OnPostMessage)
IPC_MESSAGE_FORWARD(WorkerMsg_WorkerObjectDestroyed, impl_,
WebWorker::workerObjectDestroyed)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void WebWorkerStub::OnTerminateWorkerContext() {
diff --git a/chrome/worker/webworker_stub.h b/chrome/worker/webworker_stub.h
index 76e1058..cc0d75d 100644
--- a/chrome/worker/webworker_stub.h
+++ b/chrome/worker/webworker_stub.h
@@ -22,7 +22,7 @@ class WebWorkerStub : public WebWorkerStubBase {
const WorkerAppCacheInitInfo& appcache_init_info);
// IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();
virtual const GURL& url() const;
diff --git a/chrome/worker/worker_thread.cc b/chrome/worker/worker_thread.cc
index cafd482..f7a1e4a 100644
--- a/chrome/worker/worker_thread.cc
+++ b/chrome/worker/worker_thread.cc
@@ -77,14 +77,17 @@ WorkerThread* WorkerThread::current() {
return lazy_tls.Pointer()->Get();
}
-void WorkerThread::OnControlMessageReceived(const IPC::Message& msg) {
+bool WorkerThread::OnControlMessageReceived(const IPC::Message& msg) {
// Appcache messages are handled by a delegate.
if (appcache_dispatcher_->OnMessageReceived(msg))
- return;
+ return true;
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WorkerThread, msg)
IPC_MESSAGE_HANDLER(WorkerProcessMsg_CreateWorker, OnCreateWorker)
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ return handled;
}
void WorkerThread::OnCreateWorker(
diff --git a/chrome/worker/worker_thread.h b/chrome/worker/worker_thread.h
index da154b4..1bde9b5 100644
--- a/chrome/worker/worker_thread.h
+++ b/chrome/worker/worker_thread.h
@@ -35,7 +35,7 @@ class WorkerThread : public ChildThread {
}
private:
- virtual void OnControlMessageReceived(const IPC::Message& msg);
+ virtual bool OnControlMessageReceived(const IPC::Message& msg);
virtual void OnChannelError();
void OnCreateWorker(const WorkerProcessMsg_CreateWorker_Params& params);