diff options
Diffstat (limited to 'chrome/browser')
40 files changed, 139 insertions, 93 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, |