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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 7817005: Convert some constants declared as anonymous enums into static consts so they have types. This d... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « ipc/ipc_channel_posix.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix.cc
===================================================================
--- ipc/ipc_channel_posix.cc (revision 98481)
+++ ipc/ipc_channel_posix.cc (working copy)
@@ -581,8 +581,7 @@
p = input_buf_;
end = p + bytes_read;
} else {
- if (input_overflow_buf_.size() >
- static_cast<size_t>(kMaximumMessageSize - bytes_read)) {
+ if (input_overflow_buf_.size() > (kMaximumMessageSize - bytes_read)) {
input_overflow_buf_.clear();
LOG(ERROR) << "IPC message is too big";
return false;
@@ -672,7 +671,7 @@
}
if (header_fds >
- FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE) {
+ FileDescriptorSet::kMaxDescriptorsPerMessage) {
// There are too many descriptors in this message
error = "Message requires an excessive number of descriptors";
}
@@ -778,7 +777,7 @@
msgh.msg_iov = &iov;
msgh.msg_iovlen = 1;
char buf[CMSG_SPACE(
- sizeof(int[FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE]))];
+ sizeof(int) * FileDescriptorSet::kMaxDescriptorsPerMessage)];
ssize_t bytes_written = 1;
int fd_written = -1;
@@ -789,7 +788,7 @@
struct cmsghdr *cmsg;
const unsigned num_fds = msg->file_descriptor_set()->size();
- DCHECK_LE(num_fds, FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE);
+ DCHECK(num_fds <= FileDescriptorSet::kMaxDescriptorsPerMessage);
if (msg->file_descriptor_set()->ContainsDirectoryDescriptor()) {
LOG(FATAL) << "Panic: attempting to transport directory descriptor over"
" IPC. Aborting to maintain sandbox isolation.";
@@ -811,7 +810,7 @@
msgh.msg_controllen = cmsg->cmsg_len;
// DCHECK_LE above already checks that
- // num_fds < MAX_DESCRIPTORS_PER_MESSAGE so no danger of overflow.
+ // num_fds < kMaxDescriptorsPerMessage so no danger of overflow.
msg->header()->num_fds = static_cast<uint16>(num_fds);
#if defined(IPC_USES_READWRITE)
« no previous file with comments | « ipc/ipc_channel_posix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698