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_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_ | 5 #ifndef CONTENT_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_ |
6 #define CONTENT_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_ | 6 #define CONTENT_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "content/public/common/associated_interface_registry.h" | 12 #include "content/public/common/associated_interface_registry.h" |
13 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" | 13 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 class AssociatedInterfaceRegistryImpl : public AssociatedInterfaceRegistry { | 17 class AssociatedInterfaceRegistryImpl : public AssociatedInterfaceRegistry { |
18 public: | 18 public: |
19 AssociatedInterfaceRegistryImpl(); | 19 AssociatedInterfaceRegistryImpl(); |
20 ~AssociatedInterfaceRegistryImpl() override; | 20 ~AssociatedInterfaceRegistryImpl() override; |
21 | 21 |
| 22 bool CanBindRequest(const std::string& interface_name) const; |
22 void BindRequest(const std::string& interface_name, | 23 void BindRequest(const std::string& interface_name, |
23 mojo::ScopedInterfaceEndpointHandle handle); | 24 mojo::ScopedInterfaceEndpointHandle handle); |
24 | 25 |
25 // AssociatedInterfaceRegistry: | 26 // AssociatedInterfaceRegistry: |
26 void AddInterface(const std::string& name, const Binder& binder) override; | 27 void AddInterface(const std::string& name, const Binder& binder) override; |
27 void RemoveInterface(const std::string& name) override; | 28 void RemoveInterface(const std::string& name) override; |
28 | 29 |
29 private: | 30 private: |
30 std::map<std::string, Binder> interfaces_; | 31 std::map<std::string, Binder> interfaces_; |
31 | 32 |
32 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfaceRegistryImpl); | 33 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfaceRegistryImpl); |
33 }; | 34 }; |
34 | 35 |
35 } // namespace content | 36 } // namespace content |
36 | 37 |
37 #endif // CONTENT_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_ | 38 #endif // CONTENT_COMMON_ASSOCIATED_INTERFACE_REGISTRY_IMPL_H_ |
OLD | NEW |