diff options
author | david.mike.futcher@gmail.com <david.mike.futcher@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-18 20:07:08 +0000 |
---|---|---|
committer | david.mike.futcher@gmail.com <david.mike.futcher@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-18 20:07:08 +0000 |
commit | 60ea605e068242f3dd5500e081b940a1de7370f2 (patch) | |
tree | a7d3bbb61f7d794d1646ed5a7ebfd7c0ac13acf8 | |
parent | c13014b1b5e1a8a5a6faef68ee9ad3ec123424a8 (diff) | |
download | chromium_src-60ea605e068242f3dd5500e081b940a1de7370f2.zip chromium_src-60ea605e068242f3dd5500e081b940a1de7370f2.tar.gz chromium_src-60ea605e068242f3dd5500e081b940a1de7370f2.tar.bz2 |
Replacing outdated DCHECK(a == b) with DCHECK_EQ(a, b).
This is my first attempt at contributing, so please tell me where I'm going wrong.
BUG=58409
TEST=
Review URL: http://codereview.chromium.org/6851016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81988 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | base/linux_util.cc | 2 | ||||
-rw-r--r-- | ipc/ipc_channel_posix.cc | 10 | ||||
-rw-r--r-- | net/base/mime_util.cc | 4 |
4 files changed, 9 insertions, 8 deletions
@@ -100,3 +100,4 @@ Ryan Norton <rnorton10@gmail.com> Dillon Sellars <dill.sellars@gmail.com> Seshadri Mahalingam <seshadri.mahalingam@gmail.com> Clement Scheelfeldt Skau <clementskau@gmail.com> +David Futcher <bobbo@ubuntu.com> diff --git a/base/linux_util.cc b/base/linux_util.cc index 725c602..2f9f862 100644 --- a/base/linux_util.cc +++ b/base/linux_util.cc @@ -62,7 +62,7 @@ class LinuxDistroHelper { // Indicate the check finished, move to STATE_CHECK_FINISHED. void CheckFinished() { base::AutoLock scoped_lock(lock_); - DCHECK(state_ == STATE_CHECK_STARTED); + DCHECK_EQ(STATE_CHECK_STARTED, state_); state_ = STATE_CHECK_FINISHED; } diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc index 22e4781..9d908b8 100644 --- a/ipc/ipc_channel_posix.cc +++ b/ipc/ipc_channel_posix.cc @@ -116,7 +116,7 @@ class PipeMap { // mapping if one already exists for the given channel_id void Insert(const std::string& channel_id, int fd) { base::AutoLock locked(lock_); - DCHECK(fd != -1); + DCHECK_NE(-1, fd); ChannelToFDMap::const_iterator i = map_.find(channel_id); CHECK(i == map_.end()) << "Creating second IPC server (fd " << fd << ") " @@ -556,7 +556,7 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { const unsigned payload_len = cmsg->cmsg_len - CMSG_LEN(0); - DCHECK(payload_len % sizeof(int) == 0); + DCHECK_EQ(0U, payload_len % sizeof(int)); wire_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg)); num_wire_fds = payload_len / 4; @@ -636,7 +636,7 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { const unsigned payload_len = cmsg->cmsg_len - CMSG_LEN(0); - DCHECK(payload_len % sizeof(int) == 0); + DCHECK_EQ(0U, payload_len % sizeof(int)); wire_fds = reinterpret_cast<int*>(CMSG_DATA(cmsg)); num_wire_fds = payload_len / 4; @@ -769,7 +769,7 @@ bool Channel::ChannelImpl::ProcessOutgoingMessages() { Message* msg = output_queue_.front(); size_t amt_to_write = msg->size() - message_send_bytes_written_; - DCHECK(amt_to_write != 0); + DCHECK_NE(0U, amt_to_write); const char* out_bytes = reinterpret_cast<const char*>(msg->data()) + message_send_bytes_written_; @@ -1057,7 +1057,7 @@ void Channel::ChannelImpl::OnFileCanReadWithoutBlocking(int fd) { // Called by libevent when we can write to the pipe without blocking. void Channel::ChannelImpl::OnFileCanWriteWithoutBlocking(int fd) { - DCHECK(fd == pipe_); + DCHECK_EQ(pipe_, fd); is_blocked_on_write_ = false; if (!ProcessOutgoingMessages()) { ClosePipeOnError(); diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc index 988922e..51bf964 100644 --- a/net/base/mime_util.cc +++ b/net/base/mime_util.cc @@ -385,8 +385,8 @@ bool MimeUtil::IsSupportedMimeType(const std::string& mime_type) const { bool MimeUtil::MatchesMimeType(const std::string &mime_type_pattern, const std::string &mime_type) const { // verify caller is passing lowercase - DCHECK(mime_type_pattern == StringToLowerASCII(mime_type_pattern)); - DCHECK(mime_type == StringToLowerASCII(mime_type)); + DCHECK_EQ(StringToLowerASCII(mime_type_pattern), mime_type_pattern); + DCHECK_EQ(StringToLowerASCII(mime_type), mime_type); // This comparison handles absolute maching and also basic // wildcards. The plugin mime types could be: |