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

Side by Side Diff: mojo/common/tracing_impl.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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/common/tracing_impl.h" 5 #include "mojo/common/tracing_impl.h"
6 6
7 #include "base/trace_event/trace_event_impl.h" 7 #include "base/trace_event/trace_event_impl.h"
8 #include "mojo/public/cpp/application/application_impl.h" 8 #include "mojo/public/cpp/application/application_impl.h"
9 #include "mojo/public/cpp/application/connect.h" 9 #include "mojo/public/cpp/application/connect.h"
10 #include "mojo/public/cpp/bindings/interface_handle.h" 10 #include "mojo/public/cpp/bindings/interface_handle.h"
11 #include "mojo/public/cpp/bindings/interface_request.h" 11 #include "mojo/public/cpp/bindings/interface_request.h"
12 #include "mojo/public/interfaces/application/service_provider.mojom.h"
13 #include "mojo/services/tracing/interfaces/trace_provider_registry.mojom.h" 12 #include "mojo/services/tracing/interfaces/trace_provider_registry.mojom.h"
14 #include "mojo/services/tracing/interfaces/tracing.mojom.h" 13 #include "mojo/services/tracing/interfaces/tracing.mojom.h"
15 14
16 namespace mojo { 15 namespace mojo {
17 16
18 TracingImpl::TracingImpl() {} 17 TracingImpl::TracingImpl() {}
19 18
20 TracingImpl::~TracingImpl() {} 19 TracingImpl::~TracingImpl() {}
21 20
22 void TracingImpl::Initialize(ApplicationImpl* app) { 21 void TracingImpl::Initialize(ApplicationImpl* app) {
23 tracing::TraceProviderRegistryPtr registry; 22 tracing::TraceProviderRegistryPtr registry;
24 ConnectToService(app->shell(), "mojo:tracing", GetProxy(&registry)); 23 ConnectToService(app->shell(), "mojo:tracing", GetProxy(&registry));
25 24
26 mojo::InterfaceHandle<tracing::TraceProvider> provider; 25 mojo::InterfaceHandle<tracing::TraceProvider> provider;
27 provider_impl_.Bind(GetProxy(&provider)); 26 provider_impl_.Bind(GetProxy(&provider));
28 registry->RegisterTraceProvider(provider.Pass()); 27 registry->RegisterTraceProvider(provider.Pass());
29 28
30 #ifdef NDEBUG 29 #ifdef NDEBUG
31 if (app->HasArg("--early-tracing")) { 30 if (app->HasArg("--early-tracing")) {
32 provider_impl_.ForceEnableTracing(); 31 provider_impl_.ForceEnableTracing();
33 } 32 }
34 #else 33 #else
35 provider_impl_.ForceEnableTracing(); 34 provider_impl_.ForceEnableTracing();
36 #endif 35 #endif
37 } 36 }
38 37
39 } // namespace mojo 38 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698