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

Unified Diff: mojo/shell/public/cpp/lib/service_registry.h

Issue 1578473002: Pass application ids via AcceptConnection & ConnectToApplication callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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 | « mojo/shell/public/cpp/lib/application_test_base.cc ('k') | mojo/shell/public/cpp/lib/service_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/service_registry.h
diff --git a/mojo/shell/public/cpp/lib/service_registry.h b/mojo/shell/public/cpp/lib/service_registry.h
index 1c2abc9e987a9e0c49aefcdeffefbfd1329cd465..09481e6e77067fa460536366881e0f782f726d22 100644
--- a/mojo/shell/public/cpp/lib/service_registry.h
+++ b/mojo/shell/public/cpp/lib/service_registry.h
@@ -30,6 +30,7 @@ class ServiceRegistry : public ServiceProvider, public ApplicationConnection {
// the string value "*" all interfaces may be exposed.
ServiceRegistry(const std::string& connection_url,
const std::string& remote_url,
+ uint32_t remote_id,
ServiceProviderPtr remote_services,
InterfaceRequest<ServiceProvider> local_services,
const std::set<std::string>& allowed_interfaces);
@@ -47,14 +48,16 @@ class ServiceRegistry : public ServiceProvider, public ApplicationConnection {
ServiceProvider* GetLocalServiceProvider() override;
void SetRemoteServiceProviderConnectionErrorHandler(
const Closure& handler) override;
- bool GetContentHandlerID(uint32_t* target_id) override;
- void AddContentHandlerIDCallback(const Closure& callback) override;
+ bool GetRemoteApplicationID(uint32_t* remote_id) const override;
+ bool GetRemoteContentHandlerID(uint32_t* content_handler_id) const override;
+ void AddRemoteIDCallback(const Closure& callback) override;
base::WeakPtr<ApplicationConnection> GetWeakPtr() override;
void RemoveServiceConnectorForName(const std::string& interface_name);
private:
- void OnGotContentHandlerID(uint32_t content_handler_id);
+ void OnGotRemoteIDs(uint32_t target_application_id,
+ uint32_t content_handler_id);
// ServiceProvider method.
void ConnectToService(const mojo::String& service_name,
@@ -67,11 +70,12 @@ class ServiceRegistry : public ServiceProvider, public ApplicationConnection {
ServiceConnectorRegistry service_connector_registry_;
const std::set<std::string> allowed_interfaces_;
const bool allow_all_interfaces_;
+ uint32_t remote_id_;
// The id of the content_handler is only available once the callback from
// establishing the connection is made.
uint32_t content_handler_id_;
- bool is_content_handler_id_valid_;
- std::vector<Closure> content_handler_id_callbacks_;
+ bool remote_ids_valid_;
+ std::vector<Closure> remote_id_callbacks_;
base::WeakPtrFactory<ServiceRegistry> weak_factory_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceRegistry);
« no previous file with comments | « mojo/shell/public/cpp/lib/application_test_base.cc ('k') | mojo/shell/public/cpp/lib/service_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698