| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // guaranteed to not miss any messages. But if you call this anytime after, | 157 // guaranteed to not miss any messages. But if you call this anytime after, |
| 158 // then some messages might be missed since the filter is added internally on | 158 // then some messages might be missed since the filter is added internally on |
| 159 // the IO thread. | 159 // the IO thread. |
| 160 void AddFilter(MessageFilter* filter); | 160 void AddFilter(MessageFilter* filter); |
| 161 void RemoveFilter(MessageFilter* filter); | 161 void RemoveFilter(MessageFilter* filter); |
| 162 | 162 |
| 163 using GenericAssociatedInterfaceFactory = | 163 using GenericAssociatedInterfaceFactory = |
| 164 base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>; | 164 base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>; |
| 165 | 165 |
| 166 // Adds a generic associated interface factory to bind incoming interface | 166 // Adds a generic associated interface factory to bind incoming interface |
| 167 // requests directly on the IO thread. MUST be called before Init(). | 167 // requests directly on the IO thread. MUST be called either before Init() or |
| 168 // before the remote end of the Channel is able to send messages (e.g. before |
| 169 // its process is launched.) |
| 168 void AddGenericAssociatedInterfaceForIOThread( | 170 void AddGenericAssociatedInterfaceForIOThread( |
| 169 const std::string& name, | 171 const std::string& name, |
| 170 const GenericAssociatedInterfaceFactory& factory); | 172 const GenericAssociatedInterfaceFactory& factory); |
| 171 | 173 |
| 172 // Adds a generic associated interface factory to bind incoming interface | 174 // Adds a generic associated interface factory to bind incoming interface |
| 173 // requests on the ChannelProxy's thread. MUST be called before Init(). | 175 // requests on the ChannelProxy's thread. MUST be called before Init() or |
| 176 // before the remote end of the Channel is able to send messages (e.g. before |
| 177 // its process is launched.) |
| 174 void AddGenericAssociatedInterface( | 178 void AddGenericAssociatedInterface( |
| 175 const std::string& name, | 179 const std::string& name, |
| 176 const GenericAssociatedInterfaceFactory& factory); | 180 const GenericAssociatedInterfaceFactory& factory); |
| 177 | 181 |
| 178 template <typename Interface> | 182 template <typename Interface> |
| 179 using AssociatedInterfaceFactory = | 183 using AssociatedInterfaceFactory = |
| 180 base::Callback<void(mojo::AssociatedInterfaceRequest<Interface>)>; | 184 base::Callback<void(mojo::AssociatedInterfaceRequest<Interface>)>; |
| 181 | 185 |
| 182 // Helper to bind an IO-thread associated interface factory, inferring the | 186 // Helper to bind an IO-thread associated interface factory, inferring the |
| 183 // interface name from the callback argument's type. MUST be called before | 187 // interface name from the callback argument's type. MUST be called before |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 bool did_init_; | 434 bool did_init_; |
| 431 | 435 |
| 432 #if defined(ENABLE_IPC_FUZZER) | 436 #if defined(ENABLE_IPC_FUZZER) |
| 433 OutgoingMessageFilter* outgoing_message_filter_; | 437 OutgoingMessageFilter* outgoing_message_filter_; |
| 434 #endif | 438 #endif |
| 435 }; | 439 }; |
| 436 | 440 |
| 437 } // namespace IPC | 441 } // namespace IPC |
| 438 | 442 |
| 439 #endif // IPC_IPC_CHANNEL_PROXY_H_ | 443 #endif // IPC_IPC_CHANNEL_PROXY_H_ |
| OLD | NEW |