| Index: mojo/common/trace_provider_impl.cc
|
| diff --git a/mojo/common/trace_controller_impl.cc b/mojo/common/trace_provider_impl.cc
|
| similarity index 62%
|
| rename from mojo/common/trace_controller_impl.cc
|
| rename to mojo/common/trace_provider_impl.cc
|
| index e08f88c3eeaf7a378de31cf01ab7828c40406e44..cc4fd77e4fcb60f3a0fd2e43271e6eade463f728 100644
|
| --- a/mojo/common/trace_controller_impl.cc
|
| +++ b/mojo/common/trace_provider_impl.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "mojo/common/trace_controller_impl.h"
|
| +#include "mojo/common/trace_provider_impl.h"
|
|
|
| #include "base/logging.h"
|
| #include "base/trace_event/trace_config.h"
|
| @@ -12,19 +12,18 @@
|
|
|
| namespace mojo {
|
|
|
| -TraceControllerImpl::TraceControllerImpl(
|
| - InterfaceRequest<tracing::TraceController> request)
|
| +TraceProviderImpl::TraceProviderImpl(
|
| + InterfaceRequest<tracing::TraceProvider> request)
|
| : tracing_already_started_(false), binding_(this, request.Pass()) {
|
| }
|
|
|
| -TraceControllerImpl::~TraceControllerImpl() {
|
| +TraceProviderImpl::~TraceProviderImpl() {
|
| }
|
|
|
| -void TraceControllerImpl::StartTracing(
|
| - const String& categories,
|
| - tracing::TraceDataCollectorPtr collector) {
|
| - DCHECK(!collector_.get());
|
| - collector_ = collector.Pass();
|
| +void TraceProviderImpl::StartTracing(const String& categories,
|
| + tracing::TraceRecorderPtr collector) {
|
| + DCHECK(!recorder_.get());
|
| + recorder_ = collector.Pass();
|
| if (!tracing_already_started_) {
|
| std::string categories_str = categories.To<std::string>();
|
| base::trace_event::TraceLog::GetInstance()->SetEnabled(
|
| @@ -34,21 +33,21 @@ void TraceControllerImpl::StartTracing(
|
| }
|
| }
|
|
|
| -void TraceControllerImpl::StopTracing() {
|
| - DCHECK(collector_);
|
| +void TraceProviderImpl::StopTracing() {
|
| + DCHECK(recorder_);
|
| base::trace_event::TraceLog::GetInstance()->SetDisabled();
|
|
|
| base::trace_event::TraceLog::GetInstance()->Flush(
|
| - base::Bind(&TraceControllerImpl::SendChunk, base::Unretained(this)));
|
| + base::Bind(&TraceProviderImpl::SendChunk, base::Unretained(this)));
|
| }
|
|
|
| -void TraceControllerImpl::SendChunk(
|
| +void TraceProviderImpl::SendChunk(
|
| const scoped_refptr<base::RefCountedString>& events_str,
|
| bool has_more_events) {
|
| - DCHECK(collector_);
|
| - collector_->DataCollected(mojo::String(events_str->data()));
|
| + DCHECK(recorder_);
|
| + recorder_->Record(mojo::String(events_str->data()));
|
| if (!has_more_events) {
|
| - collector_.reset();
|
| + recorder_.reset();
|
| }
|
| }
|
|
|
|
|