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

Unified Diff: mojo/common/trace_controller_impl.cc

Issue 1284293003: Rename tracing interfaces. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 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/trace_provider_impl.h » ('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
deleted file mode 100644
index e08f88c3eeaf7a378de31cf01ab7828c40406e44..0000000000000000000000000000000000000000
--- a/mojo/common/trace_controller_impl.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// 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 "base/logging.h"
-#include "base/trace_event/trace_config.h"
-#include "base/trace_event/trace_event.h"
-#include "mojo/public/cpp/application/application_connection.h"
-#include "mojo/public/cpp/application/application_impl.h"
-
-namespace mojo {
-
-TraceControllerImpl::TraceControllerImpl(
- InterfaceRequest<tracing::TraceController> request)
- : tracing_already_started_(false), binding_(this, request.Pass()) {
-}
-
-TraceControllerImpl::~TraceControllerImpl() {
-}
-
-void TraceControllerImpl::StartTracing(
- const String& categories,
- tracing::TraceDataCollectorPtr collector) {
- DCHECK(!collector_.get());
- collector_ = collector.Pass();
- if (!tracing_already_started_) {
- std::string categories_str = categories.To<std::string>();
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- base::trace_event::TraceConfig(categories_str,
- base::trace_event::RECORD_UNTIL_FULL),
- base::trace_event::TraceLog::RECORDING_MODE);
- }
-}
-
-void TraceControllerImpl::StopTracing() {
- DCHECK(collector_);
- base::trace_event::TraceLog::GetInstance()->SetDisabled();
-
- base::trace_event::TraceLog::GetInstance()->Flush(
- base::Bind(&TraceControllerImpl::SendChunk, base::Unretained(this)));
-}
-
-void TraceControllerImpl::SendChunk(
- const scoped_refptr<base::RefCountedString>& events_str,
- bool has_more_events) {
- DCHECK(collector_);
- collector_->DataCollected(mojo::String(events_str->data()));
- if (!has_more_events) {
- collector_.reset();
- }
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/common/trace_controller_impl.h ('k') | mojo/common/trace_provider_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698