| Index: mojo/common/tracing_impl.cc
|
| diff --git a/mojo/common/tracing_impl.cc b/mojo/common/tracing_impl.cc
|
| index 93f6e55bca16baa5d0072d09d4d7d1165c19ee82..827ac1722cec99f8d46d2362c15d64eb89881740 100644
|
| --- a/mojo/common/tracing_impl.cc
|
| +++ b/mojo/common/tracing_impl.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "mojo/common/tracing_impl.h"
|
|
|
| +#include <algorithm>
|
| +
|
| #include "base/trace_event/trace_event_impl.h"
|
| #include "mojo/public/cpp/application/application_impl.h"
|
| #include "mojo/public/cpp/application/connect.h"
|
| @@ -18,17 +20,19 @@ TracingImpl::TracingImpl() {}
|
|
|
| TracingImpl::~TracingImpl() {}
|
|
|
| -void TracingImpl::Initialize(ApplicationImpl* app) {
|
| +void TracingImpl::Initialize(Shell* shell,
|
| + const std::vector<std::string>* args) {
|
| tracing::TraceProviderRegistryPtr registry;
|
| - ConnectToService(app->shell(), "mojo:tracing", GetProxy(®istry));
|
| + ConnectToService(shell, "mojo:tracing", GetProxy(®istry));
|
|
|
| mojo::InterfaceHandle<tracing::TraceProvider> provider;
|
| provider_impl_.Bind(GetProxy(&provider));
|
| registry->RegisterTraceProvider(provider.Pass());
|
|
|
| #ifdef NDEBUG
|
| - if (app->HasArg("--early-tracing")) {
|
| - provider_impl_.ForceEnableTracing();
|
| + if (args) {
|
| + if (std::find(args->begin(), args->end(), "--early-tracing") != args->end())
|
| + provider_impl_.ForceEnableTracing();
|
| }
|
| #else
|
| provider_impl_.ForceEnableTracing();
|
|
|