Chromium Code Reviews| 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(®istry)); |
| -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 |