Skip to content

Commit

Permalink
Replacing outdated DCHECK(a == b) with DCHECK_EQ(a, b).
Browse files Browse the repository at this point in the history
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
  • Loading branch information
david.mike.futcher@gmail.com committed Apr 18, 2011
1 parent c13014b commit 60ea605
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion base/linux_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
10 changes: 5 additions & 5 deletions ipc/ipc_channel_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 << ") "
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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_;

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions net/base/mime_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 60ea605

Please sign in to comment.