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

Unified Diff: services/service_manager/public/cpp/lib/connector_impl.h

Issue 2804373002: Eliminate Connector::Connect(), Connection, etc. (Closed)
Patch Set: . Created 3 years, 8 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/service_manager/public/cpp/lib/connector_impl.h
diff --git a/services/service_manager/public/cpp/lib/connector_impl.h b/services/service_manager/public/cpp/lib/connector_impl.h
index 6263f44a826d719b1e4f63fc7f583c73aa9a063c..b07fb2b4648845f0e50c5190f30658bb0e54d33c 100644
--- a/services/service_manager/public/cpp/lib/connector_impl.h
+++ b/services/service_manager/public/cpp/lib/connector_impl.h
@@ -25,11 +25,11 @@ class ConnectorImpl : public Connector {
void OnConnectionError();
// Connector:
+ void StartService(const Identity& identity) override;
+ void StartService(const std::string& name) override;
void StartService(const Identity& identity,
mojom::ServicePtr service,
mojom::PIDReceiverRequest pid_receiver_request) override;
- std::unique_ptr<Connection> Connect(const std::string& name) override;
- std::unique_ptr<Connection> Connect(const Identity& target) override;
void BindInterface(const Identity& target,
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) override;
@@ -40,9 +40,15 @@ class ConnectorImpl : public Connector {
const std::string& interface_name,
const TestApi::Binder& binder) override;
void ClearBinderOverrides() override;
+ void SetStartServiceCallback(const StartServiceCallback& callback) override;
+ void ResetStartServiceCallback() override;
bool BindConnectorIfNecessary();
+ // Callback passed to mojom methods StartService()/BindInterface().
+ void StartServiceCallback(mojom::ConnectResult result,
+ const Identity& user_id);
+
using BinderOverrideMap = std::map<std::string, TestApi::Binder>;
mojom::ConnectorPtrInfo unbound_state_;
@@ -51,8 +57,9 @@ class ConnectorImpl : public Connector {
base::ThreadChecker thread_checker_;
std::map<std::string, BinderOverrideMap> local_binder_overrides_;
+ Connector::StartServiceCallback start_service_callback_;
- base::WeakPtrFactory<Connector> weak_factory_;
+ base::WeakPtrFactory<ConnectorImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ConnectorImpl);
};
« no previous file with comments | « services/service_manager/public/cpp/lib/connection_impl.cc ('k') | services/service_manager/public/cpp/lib/connector_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698