OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/public/common/simple_connection_filter.h" |
| 6 |
| 7 #include "services/service_manager/public/cpp/binder_registry.h" |
| 8 #include "services/service_manager/public/cpp/service_info.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 SimpleConnectionFilter::SimpleConnectionFilter( |
| 13 std::unique_ptr<service_manager::BinderRegistry> registry) |
| 14 : registry_(std::move(registry)) {} |
| 15 |
| 16 SimpleConnectionFilter::~SimpleConnectionFilter() {} |
| 17 |
| 18 void SimpleConnectionFilter::OnBindInterface( |
| 19 const service_manager::ServiceInfo& source_info, |
| 20 const std::string& interface_name, |
| 21 mojo::ScopedMessagePipeHandle* interface_pipe, |
| 22 service_manager::Connector* connector) { |
| 23 if (registry_->CanBindInterface(interface_name)) { |
| 24 registry_->BindInterface(source_info.identity, interface_name, |
| 25 std::move(*interface_pipe)); |
| 26 } |
| 27 } |
| 28 |
| 29 } // namespace content |
OLD | NEW |