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

Unified Diff: mojo/common/trace_controller_impl.cc

Issue 1105773002: Teach the mojo_shell --trace-startup flag to gather data from services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: buffer data from tracing service to avoid needing to frame it or add extra commas Created 5 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
« no previous file with comments | « mojo/common/trace_controller_impl.h ('k') | mojo/common/tracing_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/trace_controller_impl.cc
diff --git a/mojo/common/trace_controller_impl.cc b/mojo/common/trace_controller_impl.cc
index e7e5cd9d3fe2d9f961a017b71d76a100fce3cdab..ab1edc6262afc2fff7961ce5074a8b0442667ac1 100644
--- a/mojo/common/trace_controller_impl.cc
+++ b/mojo/common/trace_controller_impl.cc
@@ -13,7 +13,7 @@ namespace mojo {
TraceControllerImpl::TraceControllerImpl(
InterfaceRequest<tracing::TraceController> request)
- : binding_(this, request.Pass()) {
+ : tracing_already_started_(false), binding_(this, request.Pass()) {
etiennej 2015/09/11 09:43:15 I am currently looking at this code. Was there a r
}
TraceControllerImpl::~TraceControllerImpl() {
@@ -24,11 +24,13 @@ void TraceControllerImpl::StartTracing(
tracing::TraceDataCollectorPtr collector) {
DCHECK(!collector_.get());
collector_ = collector.Pass();
- std::string categories_str = categories.To<std::string>();
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- base::trace_event::CategoryFilter(categories_str),
- base::trace_event::TraceLog::RECORDING_MODE,
- base::trace_event::TraceOptions(base::trace_event::RECORD_UNTIL_FULL));
+ if (!tracing_already_started_) {
+ std::string categories_str = categories.To<std::string>();
+ base::trace_event::TraceLog::GetInstance()->SetEnabled(
+ base::trace_event::CategoryFilter(categories_str),
+ base::trace_event::TraceLog::RECORDING_MODE,
+ base::trace_event::TraceOptions(base::trace_event::RECORD_UNTIL_FULL));
+ }
}
void TraceControllerImpl::StopTracing() {
« no previous file with comments | « mojo/common/trace_controller_impl.h ('k') | mojo/common/tracing_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698