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 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
11 #include <string> | 11 #include <string> |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "ipc/ipc_message.h" | 14 #include "ipc/ipc_message.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class WaitableEvent; | 17 class WaitableEvent; |
18 } | 18 } |
19 | 19 |
20 namespace IPC { | 20 namespace IPC { |
21 | 21 |
22 class MessageReplyDeserializer; | 22 class MessageReplyDeserializer; |
23 | 23 |
24 class IPC_EXPORT SyncMessage : public Message { | 24 class IPC_EXPORT SyncMessage : public Message { |
25 public: | 25 public: |
26 SyncMessage(int32 routing_id, uint32 type, PriorityValue priority, | 26 SyncMessage(int32 routing_id, uint32 type, PriorityValue priority, |
27 MessageReplyDeserializer* deserializer); | 27 MessageReplyDeserializer* deserializer); |
28 virtual ~SyncMessage(); | 28 ~SyncMessage() override; |
29 | 29 |
30 // Call this to get a deserializer for the output parameters. | 30 // Call this to get a deserializer for the output parameters. |
31 // Note that this can only be called once, and the caller is responsible | 31 // Note that this can only be called once, and the caller is responsible |
32 // for deleting the deserializer when they're done. | 32 // for deleting the deserializer when they're done. |
33 MessageReplyDeserializer* GetReplyDeserializer(); | 33 MessageReplyDeserializer* GetReplyDeserializer(); |
34 | 34 |
35 // If this message can cause the receiver to block while waiting for user | 35 // If this message can cause the receiver to block while waiting for user |
36 // input (i.e. by calling MessageBox), then the caller needs to pump window | 36 // input (i.e. by calling MessageBox), then the caller needs to pump window |
37 // messages and dispatch asynchronous messages while waiting for the reply. | 37 // messages and dispatch asynchronous messages while waiting for the reply. |
38 // If this event is passed in, then window messages will start being pumped | 38 // If this event is passed in, then window messages will start being pumped |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 : id(id), deserializer(d), done_event(e), send_result(false) { } | 102 : id(id), deserializer(d), done_event(e), send_result(false) { } |
103 int id; | 103 int id; |
104 MessageReplyDeserializer* deserializer; | 104 MessageReplyDeserializer* deserializer; |
105 base::WaitableEvent* done_event; | 105 base::WaitableEvent* done_event; |
106 bool send_result; | 106 bool send_result; |
107 }; | 107 }; |
108 | 108 |
109 } // namespace IPC | 109 } // namespace IPC |
110 | 110 |
111 #endif // IPC_IPC_SYNC_MESSAGE_H_ | 111 #endif // IPC_IPC_SYNC_MESSAGE_H_ |
OLD | NEW |