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 #ifndef CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 // Objects interested in receiving trace data derive from TraceSubscriber. All | 14 // Objects interested in receiving trace data derive from TraceSubscriber. All |
15 // callbacks occur on the UI thread. | 15 // callbacks occur on the UI thread. |
16 // See also: trace_message_filter.h | 16 // See also: trace_message_filter.h |
17 // See also: child_trace_message_filter.h | 17 // See also: child_trace_message_filter.h |
18 class TraceSubscriber { | 18 class TraceSubscriber { |
19 public: | 19 public: |
20 // Called once after TraceController::EndTracingAsync. | 20 // Called once after TraceController::EndTracingAsync. |
21 virtual void OnEndTracingComplete() = 0; | 21 virtual void OnEndTracingComplete() = 0; |
22 | 22 |
| 23 // Called once after TraceController::ShowContinuousSamplingTracing. |
| 24 virtual void OnShowContinuousSamplingTracingComplete() {} |
| 25 |
23 // Called 0 or more times between TraceController::BeginTracing and | 26 // Called 0 or more times between TraceController::BeginTracing and |
24 // OnEndTracingComplete. Use base::debug::TraceResultBuffer to convert one or | 27 // OnEndTracingComplete. Use base::debug::TraceResultBuffer to convert one or |
25 // more trace fragments to JSON. | 28 // more trace fragments to JSON. |
26 virtual void OnTraceDataCollected( | 29 virtual void OnTraceDataCollected( |
27 const scoped_refptr<base::RefCountedString>& trace_fragment) = 0; | 30 const scoped_refptr<base::RefCountedString>& trace_fragment) = 0; |
| 31 virtual void OnContinuousSamplingTraceDataCollected( |
| 32 const scoped_refptr<base::RefCountedString>& trace_fragment) {} |
28 | 33 |
29 // Called once after TraceController::GetKnownCategoryGroupsAsync. | 34 // Called once after TraceController::GetKnownCategoryGroupsAsync. |
30 virtual void OnKnownCategoriesCollected( | 35 virtual void OnKnownCategoriesCollected( |
31 const std::set<std::string>& known_categories) {} | 36 const std::set<std::string>& known_categories) {} |
32 | 37 |
33 virtual void OnTraceBufferPercentFullReply(float percent_full) {} | 38 virtual void OnTraceBufferPercentFullReply(float percent_full) {} |
34 | 39 |
35 virtual void OnEventWatchNotification() {} | 40 virtual void OnEventWatchNotification() {} |
36 | 41 |
37 protected: | 42 protected: |
38 virtual ~TraceSubscriber() {} | 43 virtual ~TraceSubscriber() {} |
39 }; | 44 }; |
40 | 45 |
41 } // namespace content | 46 } // namespace content |
42 | 47 |
43 #endif // CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_ | 48 #endif // CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_ |
OLD | NEW |