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

Unified Diff: chrome/common/child_thread.h

Issue 1601005: Allow synchronous messages to be sent from threads other than the main thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/renderer_host/database_dispatcher_host.cc ('k') | chrome/common/child_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/child_thread.h
===================================================================
--- chrome/common/child_thread.h (revision 43588)
+++ chrome/common/child_thread.h (working copy)
@@ -15,6 +15,10 @@
class NotificationService;
class SocketStreamDispatcher;
+namespace IPC {
+class SyncMessageFilter;
+}
+
// The main thread of a child process derives from this class.
class ChildThread : public IPC::Channel::Listener,
public IPC::Message::Sender {
@@ -49,6 +53,10 @@
return socket_stream_dispatcher_.get();
}
+ // Safe to call on any thread, as long as it's guaranteed that the thread's
+ // lifetime is less than the main thread.
+ IPC::SyncMessageFilter* sync_message_filter() { return sync_message_filter_; }
+
MessageLoop* message_loop() { return message_loop_; }
// Returns the one child thread.
@@ -84,6 +92,9 @@
std::string channel_name_;
scoped_ptr<IPC::SyncChannel> channel_;
+ // Allows threads other than the main thread to send sync messages.
+ scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;
+
// Implements message routing functionality to the consumers of ChildThread.
MessageRouter router_;
« no previous file with comments | « chrome/browser/renderer_host/database_dispatcher_host.cc ('k') | chrome/common/child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698