Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1340)

Unified Diff: services/shell/public/cpp/interface_registry.h

Issue 2111353002: Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698