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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 } | 749 } |
750 | 750 |
751 bool TraceLog::HasEnabledStateObserver(EnabledStateObserver* listener) const { | 751 bool TraceLog::HasEnabledStateObserver(EnabledStateObserver* listener) const { |
752 AutoLock lock(lock_); | 752 AutoLock lock(lock_); |
753 return ContainsValue(enabled_state_observer_list_, listener); | 753 return ContainsValue(enabled_state_observer_list_, listener); |
754 } | 754 } |
755 | 755 |
756 TraceLogStatus TraceLog::GetStatus() const { | 756 TraceLogStatus TraceLog::GetStatus() const { |
757 AutoLock lock(lock_); | 757 AutoLock lock(lock_); |
758 TraceLogStatus result; | 758 TraceLogStatus result; |
759 result.event_capacity = logged_events_->Capacity(); | 759 result.event_capacity = static_cast<uint32_t>(logged_events_->Capacity()); |
760 result.event_count = logged_events_->Size(); | 760 result.event_count = static_cast<uint32_t>(logged_events_->Size()); |
761 return result; | 761 return result; |
762 } | 762 } |
763 | 763 |
764 bool TraceLog::BufferIsFull() const { | 764 bool TraceLog::BufferIsFull() const { |
765 AutoLock lock(lock_); | 765 AutoLock lock(lock_); |
766 return logged_events_->IsFull(); | 766 return logged_events_->IsFull(); |
767 } | 767 } |
768 | 768 |
769 TraceEvent* TraceLog::AddEventToThreadSharedChunkWhileLocked( | 769 TraceEvent* TraceLog::AddEventToThreadSharedChunkWhileLocked( |
770 TraceEventHandle* handle, | 770 TraceEventHandle* handle, |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 } | 1742 } |
1743 | 1743 |
1744 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 1744 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
1745 if (*category_group_enabled_) { | 1745 if (*category_group_enabled_) { |
1746 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, | 1746 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, name_, |
1747 event_handle_); | 1747 event_handle_); |
1748 } | 1748 } |
1749 } | 1749 } |
1750 | 1750 |
1751 } // namespace trace_event_internal | 1751 } // namespace trace_event_internal |
OLD | NEW |