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

Unified Diff: services/tracing/service.cc

Issue 2795883002: Eliminate OnConnect usage (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
« no previous file with comments | « services/tracing/service.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/tracing/service.cc
diff --git a/services/tracing/service.cc b/services/tracing/service.cc
index aca1ec5ed687109d5262c56b6842378a4f95560c..6eaf742e678f49980913bfdb20099e0fc8fe42df 100644
--- a/services/tracing/service.cc
+++ b/services/tracing/service.cc
@@ -14,19 +14,22 @@
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "mojo/public/cpp/system/wait.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
+#include "services/service_manager/public/cpp/service_info.h"
namespace tracing {
-Service::Service() : collector_binding_(this), tracing_active_(false) {}
+Service::Service() : collector_binding_(this), tracing_active_(false) {
+ registry_.AddInterface<mojom::Factory>(this);
+ registry_.AddInterface<mojom::Collector>(this);
+ registry_.AddInterface<mojom::StartupPerformanceDataCollector>(this);
+}
Service::~Service() {}
-bool Service::OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) {
- registry->AddInterface<mojom::Factory>(this);
- registry->AddInterface<mojom::Collector>(this);
- registry->AddInterface<mojom::StartupPerformanceDataCollector>(this);
- return true;
+void Service::OnBindInterface(const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) {
+ registry_.BindInterface(source_info.identity, interface_name,
+ std::move(interface_pipe));
}
bool Service::OnServiceManagerConnectionLost() {
« no previous file with comments | « services/tracing/service.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698