| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |