From d7d587195e0008c8bfc40d7c2e6805730ecfdba4 Mon Sep 17 00:00:00 2001 From: "jeremy@chromium.org" Date: Tue, 26 Jan 2010 11:29:44 +0000 Subject: Revert "Better handle oversized IPC messages" r37102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37104 0039d316-1c4b-4281-b951-d872f2087c98 --- ipc/ipc_channel_posix.cc | 13 ------------- ipc/ipc_channel_win.cc | 14 -------------- ipc/ipc_sync_channel.cc | 9 --------- 3 files changed, 36 deletions(-) diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index 4e00964..545ad0c 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -734,10 +734,6 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() { while (!output_queue_.empty()) { Message* msg = output_queue_.front(); - // Oversized messages should be rejected in Send(). - DCHECK_LE(msg->size(), kMaximumMessageSize) - << "Attempt to send oversized message"; - #if defined(OS_LINUX) scoped_ptr hello; if (remote_fd_pipe_ != -1 && @@ -888,15 +884,6 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() { } bool Channel::ChannelImpl::Send(Message* message) { - if(message->size(), kMaximumMessageSize) { - LOG(ERROR) << "Attempt to send oversized message " - << message->size() - << " type=" - << message->type(); - Close(); - delete message; - return false; - } #ifdef IPC_MESSAGE_DEBUG_EXTRA DLOG(INFO) << "sending message @" << message << " on channel @" << this << " with type " << message->type() diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index 788a2aa..701bce8 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -77,15 +77,6 @@ void Channel::ChannelImpl::Close() { bool Channel::ChannelImpl::Send(Message* message) { DCHECK(thread_check_->CalledOnValidThread()); - if (message->size() > kMaximumMessageSize) { - LOG(ERROR) << "Attempt to send oversized message " - << message->size() - << " type=" - << message->type(); - Close(); - delete message; - return false; - } #ifdef IPC_MESSAGE_DEBUG_EXTRA DLOG(INFO) << "sending message @" << message << " on channel @" << this << " with type " << message->type() @@ -354,11 +345,6 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages( // Write to pipe... Message* m = output_queue_.front(); - - // Oversized messages should be rejected in Send(). - DCHECK_LE(m->size(), kMaximumMessageSize) - << "Attempt to send oversized message"; - BOOL ok = WriteFile(pipe_, m->data(), m->size(), diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc index 5a100cf..3aa7a26 100644 --- a/ipc/ipc_sync_channel.cc +++ b/ipc/ipc_sync_channel.cc @@ -382,15 +382,6 @@ bool SyncChannel::Send(Message* message) { } bool SyncChannel::SendWithTimeout(Message* message, int timeout_ms) { - if(message->size() > IPC::Channel::kMaximumMessageSize) { - LOG(ERROR) << "Attempt to send oversized message " - << message->size() - << " type=" - << message->type(); - delete message; - return false; - } - if (!message->is_sync()) { ChannelProxy::Send(message); return true; -- cgit v1.1