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

Unified Diff: base/debug/trace_event_impl.cc

Issue 15418002: Record Chrome trace events in tcmalloc heap profiles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments 3 Created 7 years, 6 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
Index: base/debug/trace_event_impl.cc
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index d97c4618e904e0fdbecfe4bab73a3eee25f3b98b..f547da95868032c9e1389d1620db7bb111731c91 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -1051,6 +1051,14 @@ void TraceLog::RemoveEnabledStateObserver(EnabledStateObserver* listener) {
enabled_state_observer_list_.erase(it);
}
+bool TraceLog::HasEnabledStateObserver(EnabledStateObserver* listener) const {
+ std::vector<EnabledStateObserver*>::const_iterator it =
+ std::find(enabled_state_observer_list_.begin(),
+ enabled_state_observer_list_.end(),
+ listener);
+ return it != enabled_state_observer_list_.end();
+}
+
float TraceLog::GetBufferPercentFull() const {
return (float)((double)logged_events_->Size()/(double)kTraceEventBufferSize);
}
@@ -1075,6 +1083,9 @@ void TraceLog::SetEventCallback(EventCallback cb) {
};
void TraceLog::Flush(const TraceLog::OutputCallback& cb) {
+ // Ignore memory allocations from here down.
+ INTERNAL_TRACE_MEMORY(TRACE_DISABLED_BY_DEFAULT("memory"),
+ TRACE_MEMORY_IGNORE);
scoped_ptr<TraceBuffer> previous_logged_events;
{
AutoLock lock(lock_);

Powered by Google App Engine
This is Rietveld 408576698