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

Side by Side Diff: mojo/common/trace_provider_impl.cc

Issue 1347633002: Fix tracing C++ library (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/common/trace_provider_impl.h" 5 #include "mojo/common/trace_provider_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 base::Callback<void(const scoped_refptr<base::RefCountedString>&, 80 base::Callback<void(const scoped_refptr<base::RefCountedString>&,
81 bool)>()); 81 bool)>());
82 } 82 }
83 83
84 void TraceProviderImpl::SendChunk( 84 void TraceProviderImpl::SendChunk(
85 const scoped_refptr<base::RefCountedString>& events_str, 85 const scoped_refptr<base::RefCountedString>& events_str,
86 bool has_more_events) { 86 bool has_more_events) {
87 DCHECK(recorder_); 87 DCHECK(recorder_);
88 // The string will be empty if an error eccured or there were no trace 88 // The string will be empty if an error eccured or there were no trace
89 // events. Empty string is not a valid chunk to record so skip in this case. 89 // events. Empty string is not a valid chunk to record so skip in this case.
90 if (events_str->data().empty()) { 90 if (!events_str->data().empty()) {
91 recorder_->Record(mojo::String(events_str->data())); 91 recorder_->Record(mojo::String(events_str->data()));
92 } 92 }
93 if (!has_more_events) { 93 if (!has_more_events) {
94 recorder_.reset(); 94 recorder_.reset();
95 } 95 }
96 } 96 }
97 97
98 } // namespace mojo 98 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698