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

Unified Diff: remoting/protocol/channel_multiplexer.cc

Issue 1250403003: Fix BufferedSocketWriter not to return any results from Write(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « remoting/protocol/channel_multiplexer.h ('k') | remoting/protocol/channel_multiplexer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/channel_multiplexer.cc
diff --git a/remoting/protocol/channel_multiplexer.cc b/remoting/protocol/channel_multiplexer.cc
index e19a9a1229227a4f1ea8363f1efbbdfc80df53ec..ff5f990184baa42dbd485f18d236d03eafa458d1 100644
--- a/remoting/protocol/channel_multiplexer.cc
+++ b/remoting/protocol/channel_multiplexer.cc
@@ -84,7 +84,7 @@ class ChannelMultiplexer::MuxChannel {
// Called by MuxSocket.
void OnSocketDestroyed();
- bool DoWrite(scoped_ptr<MultiplexPacket> packet,
+ void DoWrite(scoped_ptr<MultiplexPacket> packet,
const base::Closure& done_task);
int DoRead(const scoped_refptr<net::IOBuffer>& buffer, int buffer_len);
@@ -182,7 +182,7 @@ void ChannelMultiplexer::MuxChannel::OnSocketDestroyed() {
socket_ = nullptr;
}
-bool ChannelMultiplexer::MuxChannel::DoWrite(
+void ChannelMultiplexer::MuxChannel::DoWrite(
scoped_ptr<MultiplexPacket> packet,
const base::Closure& done_task) {
packet->set_channel_id(send_id_);
@@ -190,7 +190,7 @@ bool ChannelMultiplexer::MuxChannel::DoWrite(
packet->set_channel_name(name_);
id_sent_ = true;
}
- return multiplexer_->DoWrite(packet.Pass(), done_task);
+ multiplexer_->DoWrite(packet.Pass(), done_task);
}
int ChannelMultiplexer::MuxChannel::DoRead(
@@ -256,14 +256,9 @@ int ChannelMultiplexer::MuxSocket::Write(
packet->mutable_data()->assign(buffer->data(), size);
write_pending_ = true;
- bool result = channel_->DoWrite(packet.Pass(), base::Bind(
+ channel_->DoWrite(packet.Pass(), base::Bind(
&ChannelMultiplexer::MuxSocket::OnWriteComplete, AsWeakPtr()));
- if (!result) {
- // Cannot complete the write, e.g. if the connection has been terminated.
- return net::ERR_FAILED;
- }
-
// OnWriteComplete() might be called above synchronously.
if (write_pending_) {
DCHECK(write_callback_.is_null());
@@ -465,9 +460,9 @@ void ChannelMultiplexer::OnIncomingPacket(scoped_ptr<MultiplexPacket> packet,
channel->OnIncomingPacket(packet.Pass(), done_task);
}
-bool ChannelMultiplexer::DoWrite(scoped_ptr<MultiplexPacket> packet,
+void ChannelMultiplexer::DoWrite(scoped_ptr<MultiplexPacket> packet,
const base::Closure& done_task) {
- return writer_.Write(SerializeAndFrameMessage(*packet), done_task);
+ writer_.Write(SerializeAndFrameMessage(*packet), done_task);
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/channel_multiplexer.h ('k') | remoting/protocol/channel_multiplexer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698