OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 5 |
6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 #include <string> | 10 #include <string> |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 public: | 143 public: |
144 virtual ~TraceBuffer() {} | 144 virtual ~TraceBuffer() {} |
145 | 145 |
146 virtual void AddEvent(const TraceEvent& event) = 0; | 146 virtual void AddEvent(const TraceEvent& event) = 0; |
147 virtual bool HasMoreEvents() const = 0; | 147 virtual bool HasMoreEvents() const = 0; |
148 virtual const TraceEvent& NextEvent() = 0; | 148 virtual const TraceEvent& NextEvent() = 0; |
149 virtual bool IsFull() const = 0; | 149 virtual bool IsFull() const = 0; |
150 virtual size_t CountEnabledByName(const unsigned char* category, | 150 virtual size_t CountEnabledByName(const unsigned char* category, |
151 const std::string& event_name) const = 0; | 151 const std::string& event_name) const = 0; |
152 virtual size_t Size() const = 0; | 152 virtual size_t Size() const = 0; |
| 153 virtual size_t Capacity() const = 0; |
153 virtual const TraceEvent& GetEventAt(size_t index) const = 0; | 154 virtual const TraceEvent& GetEventAt(size_t index) const = 0; |
154 }; | 155 }; |
155 | 156 |
156 // TraceResultBuffer collects and converts trace fragments returned by TraceLog | 157 // TraceResultBuffer collects and converts trace fragments returned by TraceLog |
157 // to JSON output. | 158 // to JSON output. |
158 class BASE_EXPORT TraceResultBuffer { | 159 class BASE_EXPORT TraceResultBuffer { |
159 public: | 160 public: |
160 typedef base::Callback<void(const std::string&)> OutputCallback; | 161 typedef base::Callback<void(const std::string&)> OutputCallback; |
161 | 162 |
162 // If you don't need to stream JSON chunks out efficiently, and just want to | 163 // If you don't need to stream JSON chunks out efficiently, and just want to |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 | 587 |
587 CategoryFilter category_filter_; | 588 CategoryFilter category_filter_; |
588 | 589 |
589 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 590 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
590 }; | 591 }; |
591 | 592 |
592 } // namespace debug | 593 } // namespace debug |
593 } // namespace base | 594 } // namespace base |
594 | 595 |
595 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 596 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
OLD | NEW |