OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 static void Destruct(const MessageFilter* filter) { | 106 static void Destruct(const MessageFilter* filter) { |
107 filter->OnDestruct(); | 107 filter->OnDestruct(); |
108 } | 108 } |
109 }; | 109 }; |
110 | 110 |
111 | 111 |
112 // Interface for a filter to be imposed on outgoing messages which can | 112 // Interface for a filter to be imposed on outgoing messages which can |
113 // re-write the message. Used mainly for testing. | 113 // re-write the message. Used mainly for testing. |
114 class OutgoingMessageFilter { | 114 class OutgoingMessageFilter { |
115 public: | 115 public: |
116 virtual ~OutgoingMessageFilter() { } | |
117 | |
118 // Returns a re-written message, freeing the original, or simply the | 116 // Returns a re-written message, freeing the original, or simply the |
119 // original unchanged if no rewrite indicated. | 117 // original unchanged if no rewrite indicated. |
120 virtual Message *Rewrite(Message *message) = 0; | 118 virtual Message *Rewrite(Message *message) = 0; |
121 }; | 119 }; |
122 | 120 |
123 // Initializes a channel proxy. The channel_handle and mode parameters are | 121 // Initializes a channel proxy. The channel_handle and mode parameters are |
124 // passed directly to the underlying IPC::Channel. The listener is called on | 122 // passed directly to the underlying IPC::Channel. The listener is called on |
125 // the thread that creates the ChannelProxy. The filter's OnMessageReceived | 123 // the thread that creates the ChannelProxy. The filter's OnMessageReceived |
126 // method is called on the thread where the IPC::Channel is running. The | 124 // method is called on the thread where the IPC::Channel is running. The |
127 // filter may be null if the consumer is not interested in handling messages | 125 // filter may be null if the consumer is not interested in handling messages |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 284 |
287 OutgoingMessageFilter* outgoing_message_filter_; | 285 OutgoingMessageFilter* outgoing_message_filter_; |
288 | 286 |
289 // Whether the channel has been initialized. | 287 // Whether the channel has been initialized. |
290 bool did_init_; | 288 bool did_init_; |
291 }; | 289 }; |
292 | 290 |
293 } // namespace IPC | 291 } // namespace IPC |
294 | 292 |
295 #endif // IPC_IPC_CHANNEL_PROXY_H_ | 293 #endif // IPC_IPC_CHANNEL_PROXY_H_ |
OLD | NEW |