| 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()) {
|
| }
|
|
|
| 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() {
|
|
|