OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Called on the server side when a channel that listens for connections | 55 // Called on the server side when a channel that listens for connections |
56 // denies an attempt to connect. | 56 // denies an attempt to connect. |
57 virtual void OnChannelDenied() {} | 57 virtual void OnChannelDenied() {} |
58 | 58 |
59 // Called on the server side when a channel that listens for connections | 59 // Called on the server side when a channel that listens for connections |
60 // has an error that causes the listening channel to close. | 60 // has an error that causes the listening channel to close. |
61 virtual void OnChannelListenError() {} | 61 virtual void OnChannelListenError() {} |
62 #endif // OS_POSIX | 62 #endif // OS_POSIX |
63 }; | 63 }; |
64 | 64 |
| 65 // Flags to test modes |
| 66 enum ModeFlags { |
| 67 MODE_NO_FLAG = 0x0, |
| 68 MODE_SERVER_FLAG = 0x1, |
| 69 MODE_CLIENT_FLAG = 0x2, |
| 70 MODE_NAMED_FLAG = 0x4 |
| 71 }; |
| 72 |
| 73 // Some Standard Modes |
65 enum Mode { | 74 enum Mode { |
66 MODE_NONE, | 75 MODE_NONE = MODE_NO_FLAG, |
67 MODE_SERVER, | 76 MODE_SERVER = MODE_SERVER_FLAG, |
68 MODE_CLIENT, | 77 MODE_CLIENT = MODE_CLIENT_FLAG, |
69 // Channels on Windows are named by default and accessible from other | 78 // Channels on Windows are named by default and accessible from other |
70 // processes. On POSIX channels are anonymous by default and not accessible | 79 // processes. On POSIX channels are anonymous by default and not accessible |
71 // from other processes. Named channels work via named unix domain sockets. | 80 // from other processes. Named channels work via named unix domain sockets. |
72 // On Windows MODE_NAMED_SERVER == MODE_SERVER and | 81 // On Windows MODE_NAMED_SERVER is equivalent to MODE_SERVER and |
73 // MODE_NAMED_CLIENT == MODE_CLIENT. | 82 // MODE_NAMED_CLIENT is equivalent to MODE_CLIENT. |
74 MODE_NAMED_SERVER, | 83 MODE_NAMED_SERVER = MODE_SERVER_FLAG | MODE_NAMED_FLAG, |
75 MODE_NAMED_CLIENT, | 84 MODE_NAMED_CLIENT = MODE_CLIENT_FLAG | MODE_NAMED_FLAG, |
76 }; | 85 }; |
77 | 86 |
78 enum { | 87 enum { |
79 // The maximum message size in bytes. Attempting to receive a | 88 // The maximum message size in bytes. Attempting to receive a |
80 // message of this size or bigger results in a channel error. | 89 // message of this size or bigger results in a channel error. |
81 kMaximumMessageSize = 128 * 1024 * 1024, | 90 kMaximumMessageSize = 128 * 1024 * 1024, |
82 | 91 |
83 // Ammount of data to read at once from the pipe. | 92 // Ammount of data to read at once from the pipe. |
84 kReadBufferSize = 4 * 1024 | 93 kReadBufferSize = 4 * 1024 |
85 }; | 94 }; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), | 177 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), |
169 // to avoid conflicting with normal | 178 // to avoid conflicting with normal |
170 // message types, which are enumeration | 179 // message types, which are enumeration |
171 // constants starting from 0. | 180 // constants starting from 0. |
172 }; | 181 }; |
173 }; | 182 }; |
174 | 183 |
175 } // namespace IPC | 184 } // namespace IPC |
176 | 185 |
177 #endif // IPC_IPC_CHANNEL_H_ | 186 #endif // IPC_IPC_CHANNEL_H_ |
OLD | NEW |