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

Unified Diff: mojo/common/tracing_impl.cc

Issue 1927973004: Use TraceProviderRegistry in //mojo/common/tracing_impl.*. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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 | « mojo/common/tracing_impl.h ('k') | services/tracing/tracing_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/tracing_impl.cc
diff --git a/mojo/common/tracing_impl.cc b/mojo/common/tracing_impl.cc
index a11c6cc349cff1eac5e48284d68e3d2869c5b452..ae3077948c8f0dde4c8abe35e6a5ead3985d55e3 100644
--- a/mojo/common/tracing_impl.cc
+++ b/mojo/common/tracing_impl.cc
@@ -6,9 +6,12 @@
#include "base/trace_event/trace_event_impl.h"
#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/cpp/bindings/interface_handle.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
+#include "mojo/services/tracing/interfaces/trace_provider_registry.mojom.h"
+#include "mojo/services/tracing/interfaces/tracing.mojom.h"
namespace mojo {
@@ -17,13 +20,12 @@ TracingImpl::TracingImpl() {}
TracingImpl::~TracingImpl() {}
void TracingImpl::Initialize(ApplicationImpl* app) {
- InterfaceHandle<ServiceProvider> outgoing_sp_handle;
- InterfaceRequest<ServiceProvider> outgoing_sp_request =
- GetProxy(&outgoing_sp_handle);
- app->shell()->ConnectToApplication("mojo:tracing", nullptr,
- outgoing_sp_handle.Pass());
- outgoing_sp_for_tracing_service_.Bind(outgoing_sp_request.Pass());
- outgoing_sp_for_tracing_service_.AddService(this);
+ tracing::TraceProviderRegistryPtr registry;
+ ConnectToService(app->shell(), "mojo:tracing", GetProxy(&registry));
+
+ mojo::InterfaceHandle<tracing::TraceProvider> provider;
+ provider_impl_.Bind(GetProxy(&provider));
+ registry->RegisterTraceProvider(provider.Pass());
#ifdef NDEBUG
if (app->HasArg("--early-tracing")) {
@@ -34,9 +36,4 @@ void TracingImpl::Initialize(ApplicationImpl* app) {
#endif
}
-void TracingImpl::Create(ApplicationConnection* connection,
- InterfaceRequest<tracing::TraceProvider> request) {
- provider_impl_.Bind(request.Pass());
-}
-
} // namespace mojo
« no previous file with comments | « mojo/common/tracing_impl.h ('k') | services/tracing/tracing_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698