Index: google_apis/gcm/base/socket_stream.cc |
diff --git a/google_apis/gcm/base/socket_stream.cc b/google_apis/gcm/base/socket_stream.cc |
index 14889e1f1180d3e0b45ba3a1db6d517c7f012697..edf723cdabdaf4931c4402f3b45b741925385cf6 100644 |
--- a/google_apis/gcm/base/socket_stream.cc |
+++ b/google_apis/gcm/base/socket_stream.cc |
@@ -56,8 +56,9 @@ bool SocketInputStream::Next(const void** data, int* size) { |
void SocketInputStream::BackUp(int count) { |
DCHECK(GetState() == READY || GetState() == EMPTY); |
- DCHECK_GT(count, 0); |
- DCHECK_LE(count, next_pos_); |
+ // TODO(zea): investigating crbug.com/409985 |
+ CHECK_GT(count, 0); |
+ CHECK_LE(count, next_pos_); |
next_pos_ -= count; |
DVLOG(1) << "Backing up " << count << " bytes in input buffer. " |
@@ -76,7 +77,7 @@ int64 SocketInputStream::ByteCount() const { |
return next_pos_; |
} |
-size_t SocketInputStream::UnreadByteCount() const { |
+int SocketInputStream::UnreadByteCount() const { |
DCHECK_NE(GetState(), CLOSED); |
DCHECK_NE(GetState(), READING); |
return read_buffer_->BytesConsumed() - next_pos_; |
@@ -137,6 +138,8 @@ void SocketInputStream::RebuildBuffer() { |
DVLOG(1) << "Have " << unread_data_size << " unread bytes remaining."; |
} |
read_buffer_->DidConsume(unread_data_size); |
+ // TODO(zea): investigating crbug.com/409985 |
+ CHECK_GE(UnreadByteCount(), 0); |
} |
net::Error SocketInputStream::last_error() const { |
@@ -179,6 +182,8 @@ void SocketInputStream::RefreshCompletionCallback( |
DCHECK_GT(result, 0); |
last_error_ = net::OK; |
read_buffer_->DidConsume(result); |
+ // TODO(zea): investigating crbug.com/409985 |
+ CHECK_GT(UnreadByteCount(), 0); |
DVLOG(1) << "Refresh complete with " << result << " new bytes. " |
<< "Current position " << next_pos_ |