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

Unified Diff: services/dart/dart_tracing.cc

Issue 1928183002: Use TraceProviderRegistry in //services/dart/dart_tracing.*. (Closed) Base URL: https://github.com/domokit/mojo.git@work787_trace_provider_registry_2
Patch Set: gah 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
Index: services/dart/dart_tracing.cc
diff --git a/services/dart/dart_tracing.cc b/services/dart/dart_tracing.cc
index 2bee419483767137adb201e5ad1caefa07b72daa..45104c60c7f540639e324d89fa18fc789612d5ec 100644
--- a/services/dart/dart_tracing.cc
+++ b/services/dart/dart_tracing.cc
@@ -8,9 +8,10 @@
#include "dart/runtime/include/dart_tools_api.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"
namespace dart {
@@ -133,19 +134,12 @@ DartTracingImpl::~DartTracingImpl() {
}
void DartTracingImpl::Initialize(mojo::ApplicationImpl* app) {
- mojo::InterfaceHandle<mojo::ServiceProvider> outgoing_sp_handle;
- mojo::InterfaceRequest<mojo::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));
-void DartTracingImpl::Create(
- mojo::ApplicationConnection* connection,
- mojo::InterfaceRequest<tracing::TraceProvider> request) {
- provider_impl_.Bind(request.Pass());
+ mojo::InterfaceHandle<tracing::TraceProvider> provider;
+ provider_impl_.Bind(GetProxy(&provider));
+ registry->RegisterTraceProvider(provider.Pass());
jamesr 2016/04/28 23:00:28 this feels like a buncha code that may be repeated
}
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698