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

Unified Diff: ipc/ipc_channel_proxy.h

Issue 360042: First patch in making destructors of refcounted objects private. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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
Index: ipc/ipc_channel_proxy.h
===================================================================
--- ipc/ipc_channel_proxy.h (revision 30973)
+++ ipc/ipc_channel_proxy.h (working copy)
@@ -47,10 +47,7 @@
class ChannelProxy : public Message::Sender {
public:
- class MessageFilter;
- struct MessageFilterTraits {
- static void Destruct(MessageFilter* filter);
- };
+ struct MessageFilterTraits;
// 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.
@@ -95,6 +92,12 @@
}
};
+ struct MessageFilterTraits {
+ static void Destruct(MessageFilter* filter) {
+ filter->OnDestruct();
+ }
+ };
+
// Initializes a channel proxy. The channel_id and mode parameters are
// passed directly to the underlying IPC::Channel. The listener is called on
// the thread that creates the ChannelProxy. The filter's OnMessageReceived
@@ -158,7 +161,6 @@
public:
Context(Channel::Listener* listener, MessageFilter* filter,
MessageLoop* ipc_thread);
- virtual ~Context() { }
void ClearIPCMessageLoop() { ipc_message_loop_ = NULL; }
MessageLoop* ipc_message_loop() const { return ipc_message_loop_; }
const std::string& channel_id() const { return channel_id_; }
@@ -167,6 +169,9 @@
void OnDispatchMessage(const Message& message);
protected:
+ friend class base::RefCountedThreadSafe<Context>;
M-A Ruel 2009/11/05 20:31:28 protected?
jam 2009/11/05 21:52:37 yeah, because SyncContext derives from it.
+ virtual ~Context() { }
+
// IPC::Channel::Listener methods:
virtual void OnMessageReceived(const Message& message);
virtual void OnChannelConnected(int32 peer_pid);
@@ -191,6 +196,7 @@
private:
friend class ChannelProxy;
friend class SendTask;
+
// Create the Channel
void CreateChannel(const std::string& id, const Channel::Mode& mode);

Powered by Google App Engine
This is Rietveld 408576698