| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MESSAGE_H_ | 5 #ifndef IPC_IPC_MESSAGE_H_ |
| 6 #define IPC_IPC_MESSAGE_H_ | 6 #define IPC_IPC_MESSAGE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 #if defined(OS_POSIX) | 175 #if defined(OS_POSIX) |
| 176 // On POSIX, a message supports reading / writing FileDescriptor objects. | 176 // On POSIX, a message supports reading / writing FileDescriptor objects. |
| 177 // This is used to pass a file descriptor to the peer of an IPC channel. | 177 // This is used to pass a file descriptor to the peer of an IPC channel. |
| 178 | 178 |
| 179 // Add a descriptor to the end of the set. Returns false iff the set is full. | 179 // Add a descriptor to the end of the set. Returns false iff the set is full. |
| 180 bool WriteFileDescriptor(const base::FileDescriptor& descriptor); | 180 bool WriteFileDescriptor(const base::FileDescriptor& descriptor); |
| 181 // Get a file descriptor from the message. Returns false on error. | 181 // Get a file descriptor from the message. Returns false on error. |
| 182 // iter: a Pickle iterator to the current location in the message. | 182 // iter: a Pickle iterator to the current location in the message. |
| 183 bool ReadFileDescriptor(void** iter, base::FileDescriptor* descriptor) const; | 183 bool ReadFileDescriptor(PickleIterator* iter, |
| 184 base::FileDescriptor* descriptor) const; |
| 184 #endif | 185 #endif |
| 185 | 186 |
| 186 #ifdef IPC_MESSAGE_LOG_ENABLED | 187 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 187 // Adds the outgoing time from Time::Now() at the end of the message and sets | 188 // Adds the outgoing time from Time::Now() at the end of the message and sets |
| 188 // a bit to indicate that it's been added. | 189 // a bit to indicate that it's been added. |
| 189 void set_sent_time(int64 time); | 190 void set_sent_time(int64 time); |
| 190 int64 sent_time() const; | 191 int64 sent_time() const; |
| 191 | 192 |
| 192 void set_received_time(int64 time) const; | 193 void set_received_time(int64 time) const; |
| 193 int64 received_time() const { return received_time_; } | 194 int64 received_time() const { return received_time_; } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 MSG_ROUTING_NONE = -2, | 279 MSG_ROUTING_NONE = -2, |
| 279 | 280 |
| 280 // indicates a general message not sent to a particular tab. | 281 // indicates a general message not sent to a particular tab. |
| 281 MSG_ROUTING_CONTROL = kint32max, | 282 MSG_ROUTING_CONTROL = kint32max, |
| 282 }; | 283 }; |
| 283 | 284 |
| 284 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 285 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
| 285 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 286 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
| 286 | 287 |
| 287 #endif // IPC_IPC_MESSAGE_H_ | 288 #endif // IPC_IPC_MESSAGE_H_ |
| OLD | NEW |