Chromium Code Reviews| Index: content/common/associated_interface_provider_impl.h |
| diff --git a/content/common/associated_interface_provider_impl.h b/content/common/associated_interface_provider_impl.h |
| index af01ce55427a5ee9fa6916635c7e066d05ca206a..05d7bc8a52fd24d76066ae0e6f6c112877228e6a 100644 |
| --- a/content/common/associated_interface_provider_impl.h |
| +++ b/content/common/associated_interface_provider_impl.h |
| @@ -5,6 +5,7 @@ |
| #include "content/public/common/associated_interface_provider.h" |
| #include <stdint.h> |
| +#include <memory> |
| #include "base/macros.h" |
| #include "content/common/associated_interfaces.mojom.h" |
| @@ -12,11 +13,20 @@ |
| namespace content { |
| +namespace { |
| +class LocalProvider; |
|
Ken Rockot(use gerrit already)
2016/09/20 18:26:19
Never use anonymous namespaces in headers.
LocalP
leonhsl(Using Gerrit)
2016/09/21 11:46:57
Done.
|
| +} |
| + |
| class AssociatedInterfaceProviderImpl : public AssociatedInterfaceProvider { |
| public: |
| // Binds this to a remote mojom::AssociatedInterfaceProvider. |
| explicit AssociatedInterfaceProviderImpl( |
| mojom::AssociatedInterfaceProviderAssociatedPtr proxy); |
| + // This constructor is only used for some tests when there has no injected |
| + // mojom::AssociatedInterfaceProviderAssociatedPtr. Here will emulate it |
| + // by providing self-contained local implementations of both |
| + // mojom::RouteProvider and mojom::AssociatedInterfaceProvider. |
| + AssociatedInterfaceProviderImpl(); |
| ~AssociatedInterfaceProviderImpl() override; |
| // AssociatedInterfaceProvider: |
| @@ -25,8 +35,16 @@ class AssociatedInterfaceProviderImpl : public AssociatedInterfaceProvider { |
| mojo::AssociatedGroup* GetAssociatedGroup() override; |
| private: |
| + void SetBinderForName( |
| + const std::string& name, |
| + const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) |
| + override; |
| + void ClearBinders() override; |
| + |
| mojom::AssociatedInterfaceProviderAssociatedPtr proxy_; |
| + std::unique_ptr<LocalProvider> local_provider_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AssociatedInterfaceProviderImpl); |
| }; |