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

Unified Diff: ipc/ipc_channel_proxy.h

Issue 338065: Add the ability for objects which derive from RefCountedThreadSafe to specify... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome.gyp ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.h
===================================================================
--- ipc/ipc_channel_proxy.h (revision 30647)
+++ ipc/ipc_channel_proxy.h (working copy)
@@ -46,9 +46,16 @@
//
class ChannelProxy : public Message::Sender {
public:
+
+ class MessageFilter;
+ struct MessageFilterTraits {
+ static void Destruct(MessageFilter* filter);
+ };
+
// A class that receives messages on the thread where the IPC channel is
// running. It can choose to prevent the default action for an IPC message.
- class MessageFilter : public base::RefCountedThreadSafe<MessageFilter> {
+ class MessageFilter
+ : public base::RefCountedThreadSafe<MessageFilter, MessageFilterTraits> {
public:
virtual ~MessageFilter() {}
@@ -79,6 +86,13 @@
virtual bool OnMessageReceived(const Message& message) {
return false;
}
+
+ // Called when the message filter is about to be deleted. This gives
+ // derived classes the option of controlling which thread they're deleted
+ // on etc.
+ virtual void OnDestruct() {
+ delete this;
+ }
};
// Initializes a channel proxy. The channel_id and mode parameters are
« no previous file with comments | « chrome/chrome.gyp ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698