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

Unified Diff: shell/tracer.cc

Issue 1334213002: Support for tracing app initialization. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Change BindingSet to Binding Created 5 years, 3 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
« mojo/common/trace_provider_impl.cc ('K') | « shell/tracer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/tracer.cc
diff --git a/shell/tracer.cc b/shell/tracer.cc
index ff0400d9f799cc087d612fe037c1c3df7b3613a3..62925f2ae26a31624fe6fb4a57e9adff1f3d35cf 100644
--- a/shell/tracer.cc
+++ b/shell/tracer.cc
@@ -17,11 +17,12 @@
namespace shell {
Tracer::Tracer()
- : tracing_(false), first_chunk_written_(false), trace_file_(nullptr) {
-}
+ : trace_provider_binding_(&trace_provider_impl_),
+ tracing_(false),
+ first_chunk_written_(false),
+ trace_file_(nullptr) {}
-Tracer::~Tracer() {
-}
+Tracer::~Tracer() {}
void Tracer::Start(const std::string& categories,
const std::string& duration_seconds_str,
@@ -67,8 +68,11 @@ void Tracer::StopAndFlushToFile() {
void Tracer::ConnectToProvider(
mojo::InterfaceRequest<tracing::TraceProvider> request) {
- auto impl = new mojo::TraceProviderImpl(request.Pass());
- impl->set_tracing_already_started(tracing_);
+ if (!trace_provider_binding_.is_bound()) {
+ trace_provider_binding_.Bind(request.Pass());
+ } else {
+ LOG(ERROR) << "Cannot accept two connections to TraceProvider.";
+ }
}
void Tracer::StopTracingAndFlushToDisk() {
« mojo/common/trace_provider_impl.cc ('K') | « shell/tracer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698