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

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 11823027: [Android WebView] Implement the capture picture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changes in native/Java AwContents to support SW rendering without platform functions (tests). Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« android_webview/native/aw_contents.cc ('K') | « ipc/ipc_channel_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.cc
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 0202e9e27ef665d13fe5dc30c01737fe5aaa1106..d5a965192f100f0fd6ad014e9f71814fc8b9cfa4 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -68,6 +68,18 @@ void ChannelProxy::Context::CreateChannel(const IPC::ChannelHandle& handle,
channel_.reset(new Channel(handle, mode, this));
}
+void ChannelProxy::Context::SendFailedSyncMessageReply(const Message& message) {
+ if (!message.is_sync())
+ return;
+
+ Message* reply = SyncMessage::GenerateReply(&message);
+ reply->set_reply_error();
+ ipc_task_runner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ChannelProxy::Context::OnSendMessage,
+ this, base::Passed(scoped_ptr<Message>(reply))));
+}
+
bool ChannelProxy::Context::TryFilters(const Message& message) {
#ifdef IPC_MESSAGE_LOG_ENABLED
Logging* logger = Logging::GetInstance();
@@ -243,14 +255,17 @@ void ChannelProxy::Context::OnDispatchMessage(const Message& message) {
"line", IPC_MESSAGE_ID_LINE(message.type()));
#endif
- if (!listener_)
+ if (!listener_) {
+ SendFailedSyncMessageReply(message);
return;
+ }
OnDispatchConnected();
#ifdef IPC_MESSAGE_LOG_ENABLED
if (message.type() == IPC_LOGGING_ID) {
logger->OnReceivedLoggingMessage(message);
+ SendFailedSyncMessageReply(message);
return;
}
@@ -258,7 +273,8 @@ void ChannelProxy::Context::OnDispatchMessage(const Message& message) {
logger->OnPreDispatchMessage(message);
#endif
- listener_->OnMessageReceived(message);
+ if (!listener_->OnMessageReceived(message))
+ SendFailedSyncMessageReply(message);
#ifdef IPC_MESSAGE_LOG_ENABLED
if (logger->Enabled())
« android_webview/native/aw_contents.cc ('K') | « ipc/ipc_channel_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698