| OLD | NEW |
| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 const std::string& channel_id() const { return channel_id_; } | 169 const std::string& channel_id() const { return channel_id_; } |
| 170 | 170 |
| 171 // Dispatches a message on the listener thread. | 171 // Dispatches a message on the listener thread. |
| 172 void OnDispatchMessage(const Message& message); | 172 void OnDispatchMessage(const Message& message); |
| 173 | 173 |
| 174 protected: | 174 protected: |
| 175 friend class base::RefCountedThreadSafe<Context>; | 175 friend class base::RefCountedThreadSafe<Context>; |
| 176 virtual ~Context() { } | 176 virtual ~Context() { } |
| 177 | 177 |
| 178 // IPC::Channel::Listener methods: | 178 // IPC::Channel::Listener methods: |
| 179 virtual void OnMessageReceived(const Message& message); | 179 virtual bool OnMessageReceived(const Message& message); |
| 180 virtual void OnChannelConnected(int32 peer_pid); | 180 virtual void OnChannelConnected(int32 peer_pid); |
| 181 virtual void OnChannelError(); | 181 virtual void OnChannelError(); |
| 182 | 182 |
| 183 // Like OnMessageReceived but doesn't try the filters. | 183 // Like OnMessageReceived but doesn't try the filters. |
| 184 void OnMessageReceivedNoFilter(const Message& message); | 184 bool OnMessageReceivedNoFilter(const Message& message); |
| 185 | 185 |
| 186 // Gives the filters a chance at processing |message|. | 186 // Gives the filters a chance at processing |message|. |
| 187 // Returns true if the message was processed, false otherwise. | 187 // Returns true if the message was processed, false otherwise. |
| 188 bool TryFilters(const Message& message); | 188 bool TryFilters(const Message& message); |
| 189 | 189 |
| 190 // Like Open and Close, but called on the IPC thread. | 190 // Like Open and Close, but called on the IPC thread. |
| 191 virtual void OnChannelOpened(); | 191 virtual void OnChannelOpened(); |
| 192 virtual void OnChannelClosed(); | 192 virtual void OnChannelClosed(); |
| 193 | 193 |
| 194 // Called on the consumers thread when the ChannelProxy is closed. At that | 194 // Called on the consumers thread when the ChannelProxy is closed. At that |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 // By maintaining this indirection (ref-counted) to our internal state, we | 243 // By maintaining this indirection (ref-counted) to our internal state, we |
| 244 // can safely be destroyed while the background thread continues to do stuff | 244 // can safely be destroyed while the background thread continues to do stuff |
| 245 // that involves this data. | 245 // that involves this data. |
| 246 scoped_refptr<Context> context_; | 246 scoped_refptr<Context> context_; |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 } // namespace IPC | 249 } // namespace IPC |
| 250 | 250 |
| 251 #endif // IPC_IPC_CHANNEL_PROXY_H__ | 251 #endif // IPC_IPC_CHANNEL_PROXY_H__ |
| OLD | NEW |