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

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

Issue 2402293002: Add a Javascript wrapper for InterfaceRegistry. (Closed)
Patch Set: Created 4 years, 2 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 e53f4a20dd4d8a7754ad3d19b06aee4ec185489f..b917a86827f39891f18618a563c604c8b3d8a6cf 100644
--- a/services/shell/public/cpp/interface_registry.h
+++ b/services/shell/public/cpp/interface_registry.h
@@ -61,6 +61,16 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
base::WrapUnique(binder), interface_name);
}
+ template <typename Interface>
+ void GetLocalInterface(mojo::InterfaceRequest<Interface> request) {
+ GetLocalInterface(Interface::Name_, request.PassMessagePipe());
+ }
+
+ void GetLocalInterface(const std::string& name,
+ mojo::ScopedMessagePipeHandle handle) {
+ registry_->GetInterface(name, std::move(handle));
+ }
+
private:
InterfaceRegistry* registry_;
DISALLOW_COPY_AND_ASSIGN(TestApi);

Powered by Google App Engine
This is Rietveld 408576698