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

Unified Diff: net/spdy/spdy_session.cc

Issue 1668002: SPDY: Minor code cleanup. (Closed)
Patch Set: Created 10 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 8d6d9d267edbdc64232f3058a197f323e31dac03..138deb94113beb5f3dfe43350ffd8e25090d3e09 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698