| 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 #include "content/common/associated_interface_provider_impl.h" | 5 #include "content/common/associated_interface_provider_impl.h" |
| 6 #include "mojo/public/cpp/bindings/associated_binding.h" | 6 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 7 #include "mojo/public/cpp/bindings/binding.h" | 7 #include "mojo/public/cpp/bindings/binding.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 class AssociatedInterfaceProviderImpl::LocalProvider | 11 class AssociatedInterfaceProviderImpl::LocalProvider |
| 12 : public mojom::RouteProvider, | 12 : public mojom::RouteProvider, |
| 13 mojom::AssociatedInterfaceProvider { | 13 mojom::AssociatedInterfaceProvider { |
| 14 public: | 14 public: |
| 15 explicit LocalProvider(mojom::AssociatedInterfaceProviderAssociatedPtr* proxy) | 15 explicit LocalProvider(mojom::AssociatedInterfaceProviderAssociatedPtr* proxy) |
| 16 : route_provider_binding_(this), | 16 : route_provider_binding_(this), |
| 17 associated_interface_provider_binding_(this) { | 17 associated_interface_provider_binding_(this) { |
| 18 route_provider_binding_.Bind(mojo::GetProxy(&route_provider_ptr_)); | 18 route_provider_binding_.Bind(mojo::MakeRequest(&route_provider_ptr_)); |
| 19 route_provider_ptr_->GetRoute( | 19 route_provider_ptr_->GetRoute( |
| 20 0, mojo::GetProxy(proxy, route_provider_ptr_.associated_group())); | 20 0, mojo::MakeRequest(proxy, route_provider_ptr_.associated_group())); |
| 21 } | 21 } |
| 22 | 22 |
| 23 ~LocalProvider() override {} | 23 ~LocalProvider() override {} |
| 24 | 24 |
| 25 void SetBinderForName( | 25 void SetBinderForName( |
| 26 const std::string& name, | 26 const std::string& name, |
| 27 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) { | 27 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) { |
| 28 binders_[name] = binder; | 28 binders_[name] = binder; |
| 29 } | 29 } |
| 30 | 30 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 void AssociatedInterfaceProviderImpl::OverrideBinderForTesting( | 84 void AssociatedInterfaceProviderImpl::OverrideBinderForTesting( |
| 85 const std::string& name, | 85 const std::string& name, |
| 86 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) { | 86 const base::Callback<void(mojo::ScopedInterfaceEndpointHandle)>& binder) { |
| 87 DCHECK(local_provider_); | 87 DCHECK(local_provider_); |
| 88 local_provider_->SetBinderForName(name, binder); | 88 local_provider_->SetBinderForName(name, binder); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace content | 91 } // namespace content |
| OLD | NEW |