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

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: rebase Created 4 years, 5 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
« no previous file with comments | « services/shell/public/cpp/interface_provider.h ('k') | services/shell/public/cpp/lib/connector_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0c6624e0121fd0b246d450fa166e31c0d5336d33 100644
--- a/services/shell/public/cpp/interface_registry.h
+++ b/services/shell/public/cpp/interface_registry.h
@@ -6,7 +6,10 @@
#define SERVICES_SHELL_PUBLIC_CPP_INTERFACE_REGISTRY_H_
#include <memory>
+#include <queue>
+#include <utility>
+#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 +43,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 +70,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 +142,15 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
NameToInterfaceBinderMap name_to_binder_;
+ Binder default_binder_;
+
+ bool is_paused_ = false;
+
+ // Pending interface requests which can accumulate if GetInterface() is called
+ // while binding is paused.
+ std::queue<std::pair<mojo::String, mojo::ScopedMessagePipeHandle>>
+ pending_interface_requests_;
+
base::WeakPtrFactory<InterfaceRegistry> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry);
« no previous file with comments | « services/shell/public/cpp/interface_provider.h ('k') | services/shell/public/cpp/lib/connector_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698