Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "base/trace_event/trace_log.h" | 5 #include "base/trace_event/trace_log.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 874 } | 874 } |
| 875 | 875 |
| 876 FinishFlush(gen, discard_events); | 876 FinishFlush(gen, discard_events); |
| 877 } | 877 } |
| 878 | 878 |
| 879 // Usually it runs on a different thread. | 879 // Usually it runs on a different thread. |
| 880 void TraceLog::ConvertTraceEventsToTraceFormat( | 880 void TraceLog::ConvertTraceEventsToTraceFormat( |
| 881 std::unique_ptr<TraceBuffer> logged_events, | 881 std::unique_ptr<TraceBuffer> logged_events, |
| 882 const OutputCallback& flush_output_callback, | 882 const OutputCallback& flush_output_callback, |
| 883 const ArgumentFilterPredicate& argument_filter_predicate) { | 883 const ArgumentFilterPredicate& argument_filter_predicate) { |
| 884 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("memory-infra"), | |
|
Primiano Tucci (use gerrit)
2017/07/14 14:45:04
Hmm I am not sure about this one. In all honesty h
| |
| 885 "TraceLog::ConvertTraceEventsToTraceFormat"); | |
| 884 if (flush_output_callback.is_null()) | 886 if (flush_output_callback.is_null()) |
| 885 return; | 887 return; |
| 886 | 888 |
| 887 HEAP_PROFILER_SCOPED_IGNORE; | 889 HEAP_PROFILER_SCOPED_IGNORE; |
| 888 // The callback need to be called at least once even if there is no events | 890 // The callback need to be called at least once even if there is no events |
| 889 // to let the caller know the completion of flush. | 891 // to let the caller know the completion of flush. |
| 890 scoped_refptr<RefCountedString> json_events_str_ptr = new RefCountedString(); | 892 scoped_refptr<RefCountedString> json_events_str_ptr = new RefCountedString(); |
| 891 while (const TraceBufferChunk* chunk = logged_events->NextChunk()) { | 893 while (const TraceBufferChunk* chunk = logged_events->NextChunk()) { |
| 892 for (size_t j = 0; j < chunk->size(); ++j) { | 894 for (size_t j = 0; j < chunk->size(); ++j) { |
| 893 size_t size = json_events_str_ptr->size(); | 895 size_t size = json_events_str_ptr->size(); |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1712 } | 1714 } |
| 1713 | 1715 |
| 1714 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1716 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
| 1715 if (*category_group_enabled_) { | 1717 if (*category_group_enabled_) { |
| 1716 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1718 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
| 1717 event_handle_); | 1719 event_handle_); |
| 1718 } | 1720 } |
| 1719 } | 1721 } |
| 1720 | 1722 |
| 1721 } // namespace trace_event_internal | 1723 } // namespace trace_event_internal |
| OLD | NEW |