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 29 matching lines...) Expand all Loading... |
40 mojo::ScopedInterfaceEndpointHandle handle) = 0; | 40 mojo::ScopedInterfaceEndpointHandle handle) = 0; |
41 | 41 |
42 // Returns an AssociatedGroup for the provider. This may be used to create | 42 // Returns an AssociatedGroup for the provider. This may be used to create |
43 // new associated endpoints for use with Channel-associated interfaces. | 43 // new associated endpoints for use with Channel-associated interfaces. |
44 virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0; | 44 virtual mojo::AssociatedGroup* GetAssociatedGroup() = 0; |
45 | 45 |
46 // Templated helper for GetInterface(). | 46 // Templated helper for GetInterface(). |
47 template <typename Interface> | 47 template <typename Interface> |
48 void GetInterface(mojo::AssociatedInterfacePtr<Interface>* proxy) { | 48 void GetInterface(mojo::AssociatedInterfacePtr<Interface>* proxy) { |
49 mojo::AssociatedInterfaceRequest<Interface> request = | 49 mojo::AssociatedInterfaceRequest<Interface> request = |
50 mojo::GetProxy(proxy, GetAssociatedGroup()); | 50 mojo::MakeRequest(proxy, GetAssociatedGroup()); |
51 GetInterface(Interface::Name_, request.PassHandle()); | 51 GetInterface(Interface::Name_, request.PassHandle()); |
52 } | 52 } |
53 | 53 |
54 virtual void OverrideBinderForTesting( | 54 virtual void OverrideBinderForTesting( |
55 const std::string& name, | 55 const std::string& name, |
56 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& | 56 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& |
57 binder) = 0; | 57 binder) = 0; |
58 }; | 58 }; |
59 | 59 |
60 } // namespace content | 60 } // namespace content |
61 | 61 |
62 #endif // CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_ | 62 #endif // CONTENT_PUBLIC_COMMON_ASSOCIATED_INTERFACE_PROVIDER_H_ |
OLD | NEW |