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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 6851016: multiple files: Move from DCHECK to DCHECK_EQ (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added name to Authors file, converted old DCHECKs in 2 more files Created 9 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
Index: ipc/ipc_channel_posix.cc
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 22e4781fb463f99b7fd638d266a9326a58114217..9d908b8d6b4fb3e5b92254fb45364968ca9cfeec 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();
« no previous file with comments | « base/linux_util.cc ('k') | net/base/mime_util.cc » ('j') | net/base/mime_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698