diff options
author | kushi.p@gmail.com <kushi.p@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-05 09:59:28 +0000 |
---|---|---|
committer | kushi.p@gmail.com <kushi.p@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-05 09:59:28 +0000 |
commit | 52af5d521ef5d821672f7aaabdf9fd432e48a8cc (patch) | |
tree | d669a49913eaec3848fb53c2d9ae8507b20d506a /net/base/io_buffer.cc | |
parent | 9b5b5204b65c4e8519becd77686031b720a1b0c5 (diff) | |
download | chromium_src-52af5d521ef5d821672f7aaabdf9fd432e48a8cc.zip chromium_src-52af5d521ef5d821672f7aaabdf9fd432e48a8cc.tar.gz chromium_src-52af5d521ef5d821672f7aaabdf9fd432e48a8cc.tar.bz2 |
Using DCHECK_NE/EQ/LE/GE/GT/LT() where possible. Updating logging in src/net/base/
Contributor: kushi.p@gmail.com
BUG=58409
Review URL: http://codereview.chromium.org/6905059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/io_buffer.cc')
-rw-r--r-- | net/base/io_buffer.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/base/io_buffer.cc b/net/base/io_buffer.cc index 4d9f9ad..aa04870 100644 --- a/net/base/io_buffer.cc +++ b/net/base/io_buffer.cc @@ -67,7 +67,8 @@ int DrainableIOBuffer::BytesConsumed() const { } void DrainableIOBuffer::SetOffset(int bytes) { - DCHECK(bytes >= 0 && bytes <= size_); + DCHECK_GE(bytes, 0); + DCHECK_LE(bytes, size_); used_ = bytes; data_ = base_->data() + used_; } @@ -84,7 +85,7 @@ GrowableIOBuffer::GrowableIOBuffer() } void GrowableIOBuffer::SetCapacity(int capacity) { - DCHECK(capacity >= 0); + DCHECK_GE(capacity, 0); // realloc will crash if it fails. real_data_.reset(static_cast<char*>(realloc(real_data_.release(), capacity))); capacity_ = capacity; @@ -95,7 +96,8 @@ void GrowableIOBuffer::SetCapacity(int capacity) { } void GrowableIOBuffer::set_offset(int offset) { - DCHECK(offset >= 0 && offset <= capacity_); + DCHECK_GE(offset, 0); + DCHECK_LE(offset, capacity_); offset_ = offset; data_ = real_data_.get() + offset; } |