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

Side by Side Diff: ipc/ipc_sync_channel.h

Issue 271033: Multiple sync channels if used in the same listener thread could result in ca... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/browser/renderer_host/browser_render_process_host.cc ('k') | ipc/ipc_sync_channel.cc » ('j') | 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 IPC_IPC_SYNC_SENDER_H__ 5 #ifndef IPC_IPC_SYNC_SENDER_H__
6 #define IPC_IPC_SYNC_SENDER_H__ 6 #define IPC_IPC_SYNC_SENDER_H__
7 7
8 #include <string> 8 #include <string>
9 #include <deque> 9 #include <deque>
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // synchronous send. If it is, the thread is unblocked and true is 85 // synchronous send. If it is, the thread is unblocked and true is
86 // returned. Otherwise the function returns false. 86 // returned. Otherwise the function returns false.
87 bool TryToUnblockListener(const Message* msg); 87 bool TryToUnblockListener(const Message* msg);
88 88
89 // Called on the IPC thread when a sync send that runs a nested message loop 89 // Called on the IPC thread when a sync send that runs a nested message loop
90 // times out. 90 // times out.
91 void OnSendTimeout(int message_id); 91 void OnSendTimeout(int message_id);
92 92
93 base::WaitableEvent* shutdown_event() { return shutdown_event_; } 93 base::WaitableEvent* shutdown_event() { return shutdown_event_; }
94 94
95 ReceivedSyncMsgQueue* received_sync_msgs() {
96 return received_sync_msgs_;
97 }
98
95 private: 99 private:
96 // IPC::ChannelProxy methods that we override. 100 // IPC::ChannelProxy methods that we override.
97 101
98 // Called on the listener thread. 102 // Called on the listener thread.
99 virtual void Clear(); 103 virtual void Clear();
100 104
101 // Called on the IPC thread. 105 // Called on the IPC thread.
102 virtual void OnMessageReceived(const Message& msg); 106 virtual void OnMessageReceived(const Message& msg);
103 virtual void OnChannelError(); 107 virtual void OnChannelError();
104 virtual void OnChannelOpened(); 108 virtual void OnChannelOpened();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // latter one also runs a nested message loop in the meantime. 148 // latter one also runs a nested message loop in the meantime.
145 void WaitForReply(base::WaitableEvent* pump_messages_event); 149 void WaitForReply(base::WaitableEvent* pump_messages_event);
146 150
147 // Runs a nested message loop until a reply arrives, times out, or the process 151 // Runs a nested message loop until a reply arrives, times out, or the process
148 // shuts down. 152 // shuts down.
149 void WaitForReplyWithNestedMessageLoop(); 153 void WaitForReplyWithNestedMessageLoop();
150 154
151 bool sync_messages_with_no_timeout_allowed_; 155 bool sync_messages_with_no_timeout_allowed_;
152 156
153 // Used to signal events between the IPC and listener threads. 157 // Used to signal events between the IPC and listener threads.
154 base::WaitableEventWatcher send_done_watcher_;
155 base::WaitableEventWatcher dispatch_watcher_; 158 base::WaitableEventWatcher dispatch_watcher_;
156 159
157 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); 160 DISALLOW_EVIL_CONSTRUCTORS(SyncChannel);
158 }; 161 };
159 162
160 } // namespace IPC 163 } // namespace IPC
161 164
162 #endif // IPC_IPC_SYNC_SENDER_H__ 165 #endif // IPC_IPC_SYNC_SENDER_H__
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | ipc/ipc_sync_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698