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_SYNC_MESSAGE_H_ | 5 #ifndef IPC_IPC_SYNC_MESSAGE_H_ |
6 #define IPC_IPC_SYNC_MESSAGE_H_ | 6 #define IPC_IPC_SYNC_MESSAGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <windows.h> | 11 #include <windows.h> |
12 #endif | 12 #endif |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "ipc/ipc_message.h" | 18 #include "ipc/ipc_message.h" |
19 | 19 |
| 20 namespace base { |
| 21 class WaitableEvent; |
| 22 } |
| 23 |
20 namespace IPC { | 24 namespace IPC { |
21 | 25 |
22 class MessageReplyDeserializer; | 26 class MessageReplyDeserializer; |
23 class MojoEvent; | |
24 | 27 |
25 class IPC_EXPORT SyncMessage : public Message { | 28 class IPC_EXPORT SyncMessage : public Message { |
26 public: | 29 public: |
27 SyncMessage(int32_t routing_id, | 30 SyncMessage(int32_t routing_id, |
28 uint32_t type, | 31 uint32_t type, |
29 PriorityValue priority, | 32 PriorityValue priority, |
30 MessageReplyDeserializer* deserializer); | 33 MessageReplyDeserializer* deserializer); |
31 ~SyncMessage() override; | 34 ~SyncMessage() override; |
32 | 35 |
33 // Call this to get a deserializer for the output parameters. | 36 // Call this to get a deserializer for the output parameters. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 private: | 86 private: |
84 // Derived classes need to implement this, using the given iterator (which | 87 // Derived classes need to implement this, using the given iterator (which |
85 // is skipped past the header for synchronous messages). | 88 // is skipped past the header for synchronous messages). |
86 virtual bool SerializeOutputParameters(const Message& msg, | 89 virtual bool SerializeOutputParameters(const Message& msg, |
87 base::PickleIterator iter) = 0; | 90 base::PickleIterator iter) = 0; |
88 }; | 91 }; |
89 | 92 |
90 // When sending a synchronous message, this structure contains an object | 93 // When sending a synchronous message, this structure contains an object |
91 // that knows how to deserialize the response. | 94 // that knows how to deserialize the response. |
92 struct PendingSyncMsg { | 95 struct PendingSyncMsg { |
93 PendingSyncMsg(int id, MessageReplyDeserializer* d, MojoEvent* e) | 96 PendingSyncMsg(int id, MessageReplyDeserializer* d, base::WaitableEvent* e) |
94 : id(id), deserializer(d), done_event(e), send_result(false) { } | 97 : id(id), deserializer(d), done_event(e), send_result(false) {} |
95 | 98 |
96 int id; | 99 int id; |
97 MessageReplyDeserializer* deserializer; | 100 MessageReplyDeserializer* deserializer; |
98 MojoEvent* done_event; | 101 base::WaitableEvent* done_event; |
99 bool send_result; | 102 bool send_result; |
100 }; | 103 }; |
101 | 104 |
102 } // namespace IPC | 105 } // namespace IPC |
103 | 106 |
104 #endif // IPC_IPC_SYNC_MESSAGE_H_ | 107 #endif // IPC_IPC_SYNC_MESSAGE_H_ |
OLD | NEW |