summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_sync_channel.cc
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 16:50:43 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 16:50:43 +0000
commit5855f1d67d135100626e7787e90539a1c2080e2c (patch)
tree7708cc41cdbee2071fb5d3998404949d855a81ad /ipc/ipc_sync_channel.cc
parentc5e97c352e3dd683e6a9de052e4ed6fbd64b0d57 (diff)
downloadchromium_src-5855f1d67d135100626e7787e90539a1c2080e2c.zip
chromium_src-5855f1d67d135100626e7787e90539a1c2080e2c.tar.gz
chromium_src-5855f1d67d135100626e7787e90539a1c2080e2c.tar.bz2
Remove SyncChannel::SendWithTimeout
There are no callers except tests. BUG=None Review URL: https://codereview.chromium.org/238813010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264216 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_sync_channel.cc')
-rw-r--r--ipc/ipc_sync_channel.cc28
1 files changed, 4 insertions, 24 deletions
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index 4b706e2..b2e79a8 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -411,8 +411,7 @@ SyncChannel::SyncChannel(
base::SingleThreadTaskRunner* ipc_task_runner,
bool create_pipe_now,
WaitableEvent* shutdown_event)
- : ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)),
- sync_messages_with_no_timeout_allowed_(true) {
+ : ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)) {
ChannelProxy::Init(channel_handle, mode, create_pipe_now);
StartWatching();
}
@@ -421,8 +420,7 @@ SyncChannel::SyncChannel(
Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner,
WaitableEvent* shutdown_event)
- : ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)),
- sync_messages_with_no_timeout_allowed_(true) {
+ : ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)) {
StartWatching();
}
@@ -434,18 +432,13 @@ void SyncChannel::SetRestrictDispatchChannelGroup(int group) {
}
bool SyncChannel::Send(Message* message) {
- return SendWithTimeout(message, base::kNoTimeout);
-}
-
-bool SyncChannel::SendWithTimeout(Message* message, int timeout_ms) {
#ifdef IPC_MESSAGE_LOG_ENABLED
Logging* logger = Logging::GetInstance();
std::string name;
logger->GetMessageText(message->type(), &name, message, NULL);
- TRACE_EVENT1("toplevel", "SyncChannel::SendWithTimeout",
- "name", name);
+ TRACE_EVENT1("toplevel", "SyncChannel::Send", "name", name);
#else
- TRACE_EVENT2("toplevel", "SyncChannel::SendWithTimeout",
+ TRACE_EVENT2("toplevel", "SyncChannel::Send",
"class", IPC_MESSAGE_ID_CLASS(message->type()),
"line", IPC_MESSAGE_ID_LINE(message->type()));
#endif
@@ -462,25 +455,12 @@ bool SyncChannel::SendWithTimeout(Message* message, int timeout_ms) {
return false;
}
- DCHECK(sync_messages_with_no_timeout_allowed_ ||
- timeout_ms != base::kNoTimeout);
SyncMessage* sync_msg = static_cast<SyncMessage*>(message);
context->Push(sync_msg);
- int message_id = SyncMessage::GetMessageId(*sync_msg);
WaitableEvent* pump_messages_event = sync_msg->pump_messages_event();
ChannelProxy::Send(message);
- if (timeout_ms != base::kNoTimeout) {
- // We use the sync message id so that when a message times out, we don't
- // confuse it with another send that is either above/below this Send in
- // the call stack.
- context->ipc_task_runner()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&SyncContext::OnSendTimeout, context.get(), message_id),
- base::TimeDelta::FromMilliseconds(timeout_ms));
- }
-
// Wait for reply, or for any other incoming synchronous messages.
// *this* might get deleted, so only call static functions at this point.
WaitForReply(context.get(), pump_messages_event);