summaryrefslogtreecommitdiffstats
path: root/net/spdy
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-16 22:39:09 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-16 22:39:09 +0000
commit8549f5e3dd6e920fd7c72a44ba3d89b15cc03e41 (patch)
tree917f6a79b2b80ab17da723572588a3e7f30a9741 /net/spdy
parent555da598275ab1799bd04a8940247a11af4e77bd (diff)
downloadchromium_src-8549f5e3dd6e920fd7c72a44ba3d89b15cc03e41.zip
chromium_src-8549f5e3dd6e920fd7c72a44ba3d89b15cc03e41.tar.gz
chromium_src-8549f5e3dd6e920fd7c72a44ba3d89b15cc03e41.tar.bz2
SPDY: Minor code cleanup.
Use !empty() instead of size(). Fix a LOG bug where we printed the wrong string. Use DCHECK_GT. Review URL: http://codereview.chromium.org/1668002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy')
-rw-r--r--net/spdy/spdy_session.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 8d6d9d2..138deb9 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -560,14 +560,15 @@ void SpdySession::OnReadComplete(int bytes_read) {
void SpdySession::OnWriteComplete(int result) {
DCHECK(write_pending_);
DCHECK(in_flight_write_.size());
- DCHECK(result != 0); // This shouldn't happen for write.
+ DCHECK_NE(result, 0); // This shouldn't happen for write.
write_pending_ = false;
scoped_refptr<SpdyStream> stream = in_flight_write_.stream();
LOG(INFO) << "Spdy write complete (result=" << result << ")"
- << (stream ? " for stream " + stream->stream_id() : "");
+ << (stream ? std::string(" for stream ") +
+ IntToString(stream->stream_id()) : "");
if (result >= 0) {
// It should not be possible to have written more bytes than our
@@ -675,7 +676,7 @@ void SpdySession::WriteSocket() {
// Loop sending frames until we've sent everything or until the write
// returns error (or ERR_IO_PENDING).
- while (in_flight_write_.buffer() || queue_.size()) {
+ while (in_flight_write_.buffer() || !queue_.empty()) {
if (!in_flight_write_.buffer()) {
// Grab the next SpdyFrame to send.
SpdyIOBuffer next_buffer = queue_.top();
@@ -696,7 +697,7 @@ void SpdySession::WriteSocket() {
size = compressed_frame->length() + spdy::SpdyFrame::size();
- DCHECK(size > 0);
+ DCHECK_GT(size, 0u);
// TODO(mbelshe): We have too much copying of data here.
IOBufferWithSize* buffer = new IOBufferWithSize(size);