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

Side by Side Diff: ipc/ipc_channel_proxy.h

Issue 176013: Speculative fix for a leak in SyncChannel. (Closed)
Patch Set: Created 11 years, 3 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
« no previous file with comments | « no previous file | ipc/ipc_sync_channel.h » ('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_CHANNEL_PROXY_H__ 5 #ifndef IPC_IPC_CHANNEL_PROXY_H__
6 #define IPC_IPC_CHANNEL_PROXY_H__ 6 #define IPC_IPC_CHANNEL_PROXY_H__
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // the thread that creates the ChannelProxy. The filter's OnMessageReceived 86 // the thread that creates the ChannelProxy. The filter's OnMessageReceived
87 // method is called on the thread where the IPC::Channel is running. The 87 // method is called on the thread where the IPC::Channel is running. The
88 // filter may be null if the consumer is not interested in handling messages 88 // filter may be null if the consumer is not interested in handling messages
89 // on the background thread. Any message not handled by the filter will be 89 // on the background thread. Any message not handled by the filter will be
90 // dispatched to the listener. The given message loop indicates where the 90 // dispatched to the listener. The given message loop indicates where the
91 // IPC::Channel should be created. 91 // IPC::Channel should be created.
92 ChannelProxy(const std::string& channel_id, Channel::Mode mode, 92 ChannelProxy(const std::string& channel_id, Channel::Mode mode,
93 Channel::Listener* listener, MessageFilter* filter, 93 Channel::Listener* listener, MessageFilter* filter,
94 MessageLoop* ipc_thread_loop); 94 MessageLoop* ipc_thread_loop);
95 95
96 ~ChannelProxy() { 96 virtual ~ChannelProxy() {
97 Close(); 97 Close();
98 } 98 }
99 99
100 // Close the IPC::Channel. This operation completes asynchronously, once the 100 // Close the IPC::Channel. This operation completes asynchronously, once the
101 // background thread processes the command to close the channel. It is ok to 101 // background thread processes the command to close the channel. It is ok to
102 // call this method multiple times. Redundant calls are ignored. 102 // call this method multiple times. Redundant calls are ignored.
103 // 103 //
104 // WARNING: The MessageFilter object held by the ChannelProxy is also 104 // WARNING: The MessageFilter object held by the ChannelProxy is also
105 // released asynchronously, and it may in fact have its final reference 105 // released asynchronously, and it may in fact have its final reference
106 // released on the background thread. The caller should be careful to deal 106 // released on the background thread. The caller should be careful to deal
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 // By maintaining this indirection (ref-counted) to our internal state, we 210 // By maintaining this indirection (ref-counted) to our internal state, we
211 // can safely be destroyed while the background thread continues to do stuff 211 // can safely be destroyed while the background thread continues to do stuff
212 // that involves this data. 212 // that involves this data.
213 scoped_refptr<Context> context_; 213 scoped_refptr<Context> context_;
214 }; 214 };
215 215
216 } // namespace IPC 216 } // namespace IPC
217 217
218 #endif // IPC_IPC_CHANNEL_PROXY_H__ 218 #endif // IPC_IPC_CHANNEL_PROXY_H__
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_sync_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698