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

Unified Diff: ipc/ipc_channel_posix.h

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.h ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix.h
===================================================================
--- ipc/ipc_channel_posix.h (revision 98481)
+++ ipc/ipc_channel_posix.h (working copy)
@@ -124,19 +124,18 @@
// We read from the pipe into this buffer
char input_buf_[Channel::kReadBufferSize];
- enum {
- // We assume a worst case: kReadBufferSize bytes of messages, where each
- // message has no payload and a full complement of descriptors.
- MAX_READ_FDS = (Channel::kReadBufferSize / sizeof(IPC::Message::Header)) *
- FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE,
- };
+ // We assume a worst case: kReadBufferSize bytes of messages, where each
+ // message has no payload and a full complement of descriptors.
+ static const size_t kMaxReadFDs =
+ (Channel::kReadBufferSize / sizeof(IPC::Message::Header)) *
+ FileDescriptorSet::kMaxDescriptorsPerMessage;
// This is a control message buffer large enough to hold kMaxReadFDs
#if defined(OS_MACOSX)
// TODO(agl): OSX appears to have non-constant CMSG macros!
char input_cmsg_buf_[1024];
#else
- char input_cmsg_buf_[CMSG_SPACE(sizeof(int) * MAX_READ_FDS)];
+ char input_cmsg_buf_[CMSG_SPACE(sizeof(int) * kMaxReadFDs)];
#endif
// Large messages that span multiple pipe buffers, get built-up using
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698