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

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

Issue 1311353005: Adds a way to determine id of content handler that created app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nuke comment Created 5 years, 4 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: mojo/application/public/cpp/lib/service_registry.h
diff --git a/mojo/application/public/cpp/lib/service_registry.h b/mojo/application/public/cpp/lib/service_registry.h
index 8cb1d1b411c7e1aa092a9b604c82f726f9dbf737..c3610bf6de85157ef371dd68eb7574b773332f68 100644
--- a/mojo/application/public/cpp/lib/service_registry.h
+++ b/mojo/application/public/cpp/lib/service_registry.h
@@ -11,6 +11,7 @@
#include "mojo/application/public/cpp/application_connection.h"
#include "mojo/application/public/cpp/lib/service_connector_registry.h"
#include "mojo/application/public/interfaces/service_provider.mojom.h"
+#include "mojo/application/public/interfaces/shell.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
namespace mojo {
@@ -32,6 +33,8 @@ class ServiceRegistry : public ServiceProvider, public ApplicationConnection {
const std::set<std::string>& allowed_interfaces);
~ServiceRegistry() override;
+ Shell::ConnectToApplicationCallback GetConnectToApplicationCallback();
+
// ApplicationConnection overrides.
void SetServiceConnector(ServiceConnector* service_connector) override;
bool SetServiceConnectorForName(ServiceConnector* service_connector,
@@ -42,11 +45,15 @@ 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;
base::WeakPtr<ApplicationConnection> GetWeakPtr() override;
void RemoveServiceConnectorForName(const std::string& interface_name);
private:
+ void OnGotContentHandlerID(uint32_t content_handler_id);
+
// ServiceProvider method.
void ConnectToService(const mojo::String& service_name,
ScopedMessagePipeHandle client_handle) override;
@@ -58,7 +65,12 @@ class ServiceRegistry : public ServiceProvider, public ApplicationConnection {
ServiceConnectorRegistry service_connector_registry_;
const std::set<std::string> allowed_interfaces_;
const bool allow_all_interfaces_;
- base::WeakPtrFactory<ApplicationConnection> weak_factory_;
+ // 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_;
+ base::WeakPtrFactory<ServiceRegistry> weak_factory_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ServiceRegistry);
};
« no previous file with comments | « mojo/application/public/cpp/lib/application_impl.cc ('k') | mojo/application/public/cpp/lib/service_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698