Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: chrome/common/ipc_sync_message.h

Issue 8001: Make IPC::SyncChannel not duplicate the underlying MessageLoop implementation... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/ipc_sync_channel_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_COMMON_IPC_SYNC_MESSAGE_H__ 5 #ifndef CHROME_COMMON_IPC_SYNC_MESSAGE_H__
6 #define CHROME_COMMON_IPC_SYNC_MESSAGE_H__ 6 #define CHROME_COMMON_IPC_SYNC_MESSAGE_H__
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <string> 9 #include <string>
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "chrome/common/ipc_message.h" 11 #include "chrome/common/ipc_message.h"
12 12
13 namespace IPC { 13 namespace IPC {
14 14
15 class MessageReplyDeserializer; 15 class MessageReplyDeserializer;
16 16
17 class SyncMessage : public Message { 17 class SyncMessage : public Message {
18 public: 18 public:
19 SyncMessage(int32 routing_id, WORD type, PriorityValue priority, 19 SyncMessage(int32 routing_id, WORD type, PriorityValue priority,
20 MessageReplyDeserializer* deserializer); 20 MessageReplyDeserializer* deserializer);
21 21
22 // Call this to get a deserializer for the output parameters. 22 // Call this to get a deserializer for the output parameters.
23 // Note that this can only be called once, and the caller is responsible 23 // Note that this can only be called once, and the caller is responsible
24 // for deleting the deserializer when they're done. 24 // for deleting the deserializer when they're done.
25 MessageReplyDeserializer* GetReplyDeserializer(); 25 MessageReplyDeserializer* GetReplyDeserializer();
26 26
27 // If this message can cause the receiver to block while waiting for user 27 // If this message can cause the receiver to block while waiting for user
28 // input (i.e. by calling MessageBox), then the caller needs to pump window 28 // input (i.e. by calling MessageBox), then the caller needs to pump window
29 // messages and dispatch asynchronous messages while waiting for the reply. 29 // messages and dispatch asynchronous messages while waiting for the reply.
30 // If this handle is passed in, then window messages will be pumped while 30 // If this handle is passed in, then window messages will start being pumped
31 // it's set. The handle must be valid until after the Send call returns. 31 // when it's set. Note that this behavior will continue even if the event is
32 // later reset. The handle must be valid until after the Send call returns.
32 void set_pump_messages_event(HANDLE event) { 33 void set_pump_messages_event(HANDLE event) {
33 pump_messages_event_ = event; 34 pump_messages_event_ = event;
34 if (event) { 35 if (event) {
35 header()->flags |= PUMPING_MSGS_BIT; 36 header()->flags |= PUMPING_MSGS_BIT;
36 } else { 37 } else {
37 header()->flags &= ~PUMPING_MSGS_BIT; 38 header()->flags &= ~PUMPING_MSGS_BIT;
38 } 39 }
39 } 40 }
40 41
41 // Call this if you always want to pump messages. You can call this method 42 // Call this if you always want to pump messages. You can call this method
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 private: 80 private:
80 // Derived classes need to implement this, using the given iterator (which 81 // Derived classes need to implement this, using the given iterator (which
81 // is skipped past the header for synchronous messages). 82 // is skipped past the header for synchronous messages).
82 virtual bool SerializeOutputParameters(const Message& msg, void* iter) = 0; 83 virtual bool SerializeOutputParameters(const Message& msg, void* iter) = 0;
83 }; 84 };
84 85
85 } // namespace IPC 86 } // namespace IPC
86 87
87 #endif // CHROME_COMMON_IPC_SYNC_MESSAGE_H__ 88 #endif // CHROME_COMMON_IPC_SYNC_MESSAGE_H__
88 89
OLDNEW
« no previous file with comments | « chrome/common/ipc_sync_channel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698