OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_ |
6 #define CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_ | 6 #define CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 10 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // new associated endpoints for use with Channel-associated interfaces. | 42 // new associated endpoints for use with Channel-associated interfaces. |
43 virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0; | 43 virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0; |
44 | 44 |
45 // Templated helper for GetInterface(). | 45 // Templated helper for GetInterface(). |
46 template <typename Interface> | 46 template <typename Interface> |
47 void GetInterface(mojo::AssociatedInterfacePtr<Interface>* proxy) { | 47 void GetInterface(mojo::AssociatedInterfacePtr<Interface>* proxy) { |
48 mojo::AssociatedInterfaceRequest<Interface> request = | 48 mojo::AssociatedInterfaceRequest<Interface> request = |
49 mojo::GetProxy(proxy, GetAssociatedGroup()); | 49 mojo::GetProxy(proxy, GetAssociatedGroup()); |
50 GetInterface(Interface::Name_, request.PassHandle()); | 50 GetInterface(Interface::Name_, request.PassHandle()); |
51 } | 51 } |
| 52 |
| 53 virtual void OverrideBinderForTesting( |
| 54 const std::string& name, |
| 55 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& |
| 56 binder) = 0; |
52 }; | 57 }; |
53 | 58 |
54 } // namespace content | 59 } // namespace content |
55 | 60 |
56 #endif // CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_ | 61 #endif // CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_ |
OLD | NEW |