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

Side by Side Diff: ipc/ipc_channel.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, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/file_descriptor_set_posix_unittest.cc ('k') | ipc/ipc_channel_posix.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IPC_IPC_CHANNEL_H_ 5 #ifndef IPC_IPC_CHANNEL_H_
6 #define IPC_IPC_CHANNEL_H_ 6 #define IPC_IPC_CHANNEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ipc/ipc_channel_handle.h" 10 #include "ipc/ipc_channel_handle.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 MODE_NAMED_CLIENT = MODE_CLIENT_FLAG | MODE_NAMED_FLAG, 87 MODE_NAMED_CLIENT = MODE_CLIENT_FLAG | MODE_NAMED_FLAG,
88 #if defined(OS_POSIX) 88 #if defined(OS_POSIX)
89 // An "open" named server accepts connections from ANY client. 89 // An "open" named server accepts connections from ANY client.
90 // The caller must then implement their own access-control based on the 90 // The caller must then implement their own access-control based on the
91 // client process' user Id. 91 // client process' user Id.
92 MODE_OPEN_NAMED_SERVER = MODE_OPEN_ACCESS_FLAG | MODE_SERVER_FLAG | 92 MODE_OPEN_NAMED_SERVER = MODE_OPEN_ACCESS_FLAG | MODE_SERVER_FLAG |
93 MODE_NAMED_FLAG 93 MODE_NAMED_FLAG
94 #endif 94 #endif
95 }; 95 };
96 96
97 enum { 97 // The maximum message size in bytes. Attempting to receive a message of this
98 // The maximum message size in bytes. Attempting to receive a 98 // size or bigger results in a channel error.
99 // message of this size or bigger results in a channel error. 99 static const size_t kMaximumMessageSize = 128 * 1024 * 1024;
100 kMaximumMessageSize = 128 * 1024 * 1024,
101 100
102 // Ammount of data to read at once from the pipe. 101 // Ammount of data to read at once from the pipe.
103 kReadBufferSize = 4 * 1024 102 static const size_t kReadBufferSize = 4 * 1024;
104 };
105 103
106 // Initialize a Channel. 104 // Initialize a Channel.
107 // 105 //
108 // |channel_handle| identifies the communication Channel. For POSIX, if 106 // |channel_handle| identifies the communication Channel. For POSIX, if
109 // the file descriptor in the channel handle is != -1, the channel takes 107 // the file descriptor in the channel handle is != -1, the channel takes
110 // ownership of the file descriptor and will close it appropriately, otherwise 108 // ownership of the file descriptor and will close it appropriately, otherwise
111 // it will create a new descriptor internally. 109 // it will create a new descriptor internally.
112 // |mode| specifies whether this Channel is to operate in server mode or 110 // |mode| specifies whether this Channel is to operate in server mode or
113 // client mode. In server mode, the Channel is responsible for setting up the 111 // client mode. In server mode, the Channel is responsible for setting up the
114 // IPC object, whereas in client mode, the Channel merely connects to the 112 // IPC object, whereas in client mode, the Channel merely connects to the
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), 193 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16),
196 // to avoid conflicting with normal 194 // to avoid conflicting with normal
197 // message types, which are enumeration 195 // message types, which are enumeration
198 // constants starting from 0. 196 // constants starting from 0.
199 }; 197 };
200 }; 198 };
201 199
202 } // namespace IPC 200 } // namespace IPC
203 201
204 #endif // IPC_IPC_CHANNEL_H_ 202 #endif // IPC_IPC_CHANNEL_H_
OLDNEW
« no previous file with comments | « ipc/file_descriptor_set_posix_unittest.cc ('k') | ipc/ipc_channel_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698