| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // The following four functions are needed so we can log sync messages with | 217 // The following four functions are needed so we can log sync messages with |
| 218 // delayed replies. We stick the log data from the sent message into the | 218 // delayed replies. We stick the log data from the sent message into the |
| 219 // reply message, so that when it's sent and we have the output parameters | 219 // reply message, so that when it's sent and we have the output parameters |
| 220 // we can log it. As such, we set a flag on the sent message to not log it. | 220 // we can log it. As such, we set a flag on the sent message to not log it. |
| 221 void set_sync_log_data(LogData* data) const { log_data_ = data; } | 221 void set_sync_log_data(LogData* data) const { log_data_ = data; } |
| 222 LogData* sync_log_data() const { return log_data_; } | 222 LogData* sync_log_data() const { return log_data_; } |
| 223 void set_dont_log() const { dont_log_ = true; } | 223 void set_dont_log() const { dont_log_ = true; } |
| 224 bool dont_log() const { return dont_log_; } | 224 bool dont_log() const { return dont_log_; } |
| 225 #endif | 225 #endif |
| 226 | 226 |
| 227 // Called at various points between send and receive to track message. | 227 // Called to trace when message is sent. |
| 228 void TraceMessageStep() { | 228 void TraceMessageBegin() { |
| 229 TRACE_EVENT_ASYNC_STEP0("ipc", "IPC", header()->flags, "step"); | 229 TRACE_EVENT_FLOW_BEGIN0("ipc", "IPC", header()->flags); |
| 230 } |
| 231 // Called to trace when message is received. |
| 232 void TraceMessageEnd() { |
| 233 TRACE_EVENT_FLOW_END0("ipc", "IPC", header()->flags); |
| 230 } | 234 } |
| 231 | 235 |
| 232 protected: | 236 protected: |
| 233 friend class Channel; | 237 friend class Channel; |
| 234 friend class MessageReplyDeserializer; | 238 friend class MessageReplyDeserializer; |
| 235 friend class SyncMessage; | 239 friend class SyncMessage; |
| 236 | 240 |
| 237 #pragma pack(push, 4) | 241 #pragma pack(push, 4) |
| 238 struct Header : Pickle::Header { | 242 struct Header : Pickle::Header { |
| 239 int32 routing; // ID of the view that this message is destined for | 243 int32 routing; // ID of the view that this message is destined for |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 MSG_ROUTING_NONE = -2, | 293 MSG_ROUTING_NONE = -2, |
| 290 | 294 |
| 291 // indicates a general message not sent to a particular tab. | 295 // indicates a general message not sent to a particular tab. |
| 292 MSG_ROUTING_CONTROL = kint32max, | 296 MSG_ROUTING_CONTROL = kint32max, |
| 293 }; | 297 }; |
| 294 | 298 |
| 295 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 299 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
| 296 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 300 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
| 297 | 301 |
| 298 #endif // IPC_IPC_MESSAGE_H_ | 302 #endif // IPC_IPC_MESSAGE_H_ |
| OLD | NEW |