| 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 |
| 116 // Returns a re-written message, freeing the original, or simply the | 118 // Returns a re-written message, freeing the original, or simply the |
| 117 // original unchanged if no rewrite indicated. | 119 // original unchanged if no rewrite indicated. |
| 118 virtual Message *Rewrite(Message *message) = 0; | 120 virtual Message *Rewrite(Message *message) = 0; |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 // Initializes a channel proxy. The channel_handle and mode parameters are | 123 // Initializes a channel proxy. The channel_handle and mode parameters are |
| 122 // passed directly to the underlying IPC::Channel. The listener is called on | 124 // passed directly to the underlying IPC::Channel. The listener is called on |
| 123 // the thread that creates the ChannelProxy. The filter's OnMessageReceived | 125 // the thread that creates the ChannelProxy. The filter's OnMessageReceived |
| 124 // method is called on the thread where the IPC::Channel is running. The | 126 // method is called on the thread where the IPC::Channel is running. The |
| 125 // filter may be null if the consumer is not interested in handling messages | 127 // 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... |
| 284 | 286 |
| 285 OutgoingMessageFilter* outgoing_message_filter_; | 287 OutgoingMessageFilter* outgoing_message_filter_; |
| 286 | 288 |
| 287 // Whether the channel has been initialized. | 289 // Whether the channel has been initialized. |
| 288 bool did_init_; | 290 bool did_init_; |
| 289 }; | 291 }; |
| 290 | 292 |
| 291 } // namespace IPC | 293 } // namespace IPC |
| 292 | 294 |
| 293 #endif // IPC_IPC_CHANNEL_PROXY_H_ | 295 #endif // IPC_IPC_CHANNEL_PROXY_H_ |
| OLD | NEW |