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

Unified Diff: mojo/common/tracing_impl.cc

Issue 2014043002: Make TracingImpl take a Shell* and args, instead of an ApplicationImpl*. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/common/tracing_impl.h ('k') | services/dart/content_handler_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 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(&registry));
+ ConnectToService(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")) {
- provider_impl_.ForceEnableTracing();
+ if (args) {
+ if (std::find(args->begin(), args->end(), "--early-tracing") != args->end())
+ provider_impl_.ForceEnableTracing();
}
#else
provider_impl_.ForceEnableTracing();
« no previous file with comments | « mojo/common/tracing_impl.h ('k') | services/dart/content_handler_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698