Index: services/shell/public/cpp/interface_registry.h |
diff --git a/services/shell/public/cpp/interface_registry.h b/services/shell/public/cpp/interface_registry.h |
index 98f85550fab9959bc538ecc86782f0fe86b82ceb..0005b4510ed6061d8b5fd502c3f01575ed69d579 100644 |
--- a/services/shell/public/cpp/interface_registry.h |
+++ b/services/shell/public/cpp/interface_registry.h |
@@ -7,6 +7,7 @@ |
#include <memory> |
+#include "base/callback.h" |
#include "base/memory/ptr_util.h" |
#include "mojo/public/cpp/bindings/binding.h" |
#include "services/shell/public/cpp/lib/callback_binder.h" |
@@ -40,6 +41,9 @@ class InterfaceBinder; |
// |
class InterfaceRegistry : public mojom::InterfaceProvider { |
public: |
+ using Binder = base::Callback<void(const mojo::String&, |
+ mojo::ScopedMessagePipeHandle)>; |
+ |
class TestApi { |
public: |
explicit TestApi(InterfaceRegistry* registry) : registry_(registry) {} |
@@ -64,6 +68,10 @@ class InterfaceRegistry : public mojom::InterfaceProvider { |
explicit InterfaceRegistry(Connection* connection); |
~InterfaceRegistry() override; |
+ // Sets a default handler for incoming interface requests which are allowed by |
+ // capability filters but have no registered handler in this registry. |
+ void set_default_binder(const Binder& binder) { default_binder_ = binder; } |
+ |
void Bind(mojom::InterfaceProviderRequest local_interfaces_request); |
base::WeakPtr<InterfaceRegistry> GetWeakPtr(); |
@@ -132,6 +140,8 @@ class InterfaceRegistry : public mojom::InterfaceProvider { |
NameToInterfaceBinderMap name_to_binder_; |
+ Binder default_binder_; |
+ |
base::WeakPtrFactory<InterfaceRegistry> weak_factory_; |
DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry); |