diff options
-rw-r--r-- | chrome/common/ipc_test_sink.cc | 3 | ||||
-rw-r--r-- | chrome/common/ipc_test_sink.h | 2 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.h | 4 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 12 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.h | 2 |
5 files changed, 14 insertions, 9 deletions
diff --git a/chrome/common/ipc_test_sink.cc b/chrome/common/ipc_test_sink.cc index 45db8f5..69d328c 100644 --- a/chrome/common/ipc_test_sink.cc +++ b/chrome/common/ipc_test_sink.cc @@ -19,8 +19,9 @@ bool TestSink::Send(IPC::Message* message) { return true; } -void TestSink::OnMessageReceived(const Message& msg) { +bool TestSink::OnMessageReceived(const Message& msg) { messages_.push_back(Message(msg)); + return true; } void TestSink::ClearMessages() { diff --git a/chrome/common/ipc_test_sink.h b/chrome/common/ipc_test_sink.h index caf6276..05720d4 100644 --- a/chrome/common/ipc_test_sink.h +++ b/chrome/common/ipc_test_sink.h @@ -54,7 +54,7 @@ class TestSink : public IPC::Channel { // Used by the source of the messages to send the message to the sink. This // will make a copy of the message and store it in the list. - void OnMessageReceived(const Message& msg); + bool OnMessageReceived(const Message& msg); // Returns the number of messages in the queue. size_t message_count() const { return messages_.size(); } diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index 82f65ac..63c7f79 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -48,7 +48,9 @@ class TabProxy : public AutomationResourceProxy, public: class TabProxyDelegate { public: - virtual void OnMessageReceived(TabProxy* tab, const IPC::Message& msg) {} + virtual bool OnMessageReceived(TabProxy* tab, const IPC::Message& msg) { + return false; + } virtual void OnChannelError(TabProxy* tab) {} protected: diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index a026669..d24188a 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -73,13 +73,14 @@ class ChromeFrameAutomationProxyImpl::TabProxyNotificationMessageFilter // Get AddRef-ed pointer to corresponding TabProxy object TabProxy* tab = static_cast<TabProxy*>(tracker_->GetResource( message.routing_id())); + bool handled = false; if (tab) { tab->OnMessageReceived(message); - tab->Release(); + handled = tab->Release(); } else { DLOG(ERROR) << "Failed to find TabProxy for tab:" << message.routing_id(); } - return true; + return handled; } virtual void OnChannelError() { @@ -1168,19 +1169,20 @@ bool ChromeFrameAutomationClient::ProcessUrlRequestMessage(TabProxy* tab, // kind of beings. // By default we marshal the IPC message to the main/GUI thread and from there // we safely invoke chrome_frame_delegate_->OnMessageReceived(msg). -void ChromeFrameAutomationClient::OnMessageReceived(TabProxy* tab, +bool ChromeFrameAutomationClient::OnMessageReceived(TabProxy* tab, const IPC::Message& msg) { DCHECK(tab == tab_.get()); // Quickly process network related messages. if (url_fetcher_ && ProcessUrlRequestMessage(tab, msg, false)) - return; + return true; // Early check to avoid needless marshaling if (chrome_frame_delegate_ == NULL) - return; + return false; PostTask(FROM_HERE, NewRunnableMethod(this, &ChromeFrameAutomationClient::OnMessageReceivedUIThread, msg)); + return true; } void ChromeFrameAutomationClient::OnChannelError(TabProxy* tab) { diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index 7432ee2..5b7ec85 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -459,7 +459,7 @@ class ChromeFrameAutomationClient virtual void AutomationServerDied(); // TabProxyDelegate implementation - virtual void OnMessageReceived(TabProxy* tab, const IPC::Message& msg); + virtual bool OnMessageReceived(TabProxy* tab, const IPC::Message& msg); virtual void OnChannelError(TabProxy* tab); void CreateExternalTab(); |