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_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // When the TraceBufferPercentFull value is determined, | 63 // When the TraceBufferPercentFull value is determined, |
64 // subscriber->OnTraceBufferPercentFullReply is called. | 64 // subscriber->OnTraceBufferPercentFullReply is called. |
65 // When any child process reaches 100% full, the TraceController will end | 65 // When any child process reaches 100% full, the TraceController will end |
66 // tracing, and call TraceSubscriber::OnEndTracingComplete. | 66 // tracing, and call TraceSubscriber::OnEndTracingComplete. |
67 // GetTraceBufferPercentFullAsync fails in the following conditions: | 67 // GetTraceBufferPercentFullAsync fails in the following conditions: |
68 // trace is ending or disabled; | 68 // trace is ending or disabled; |
69 // a previous call to GetTraceBufferPercentFullAsync is pending; or | 69 // a previous call to GetTraceBufferPercentFullAsync is pending; or |
70 // the caller is not the current subscriber. | 70 // the caller is not the current subscriber. |
71 virtual bool GetTraceBufferPercentFullAsync(TraceSubscriber* subscriber) = 0; | 71 virtual bool GetTraceBufferPercentFullAsync(TraceSubscriber* subscriber) = 0; |
72 | 72 |
| 73 // After |num_occurrences| of given event have been seen on a particular |
| 74 // process, |subscriber->OnEventWatchNotification()| will be called. The event |
| 75 // count is not distributed across processes, so |num_occurrences| must occur |
| 76 // on one process. The watch event is automatically cleared after the |
| 77 // notification. |num_occurrences| must be greater than 0. |
| 78 virtual bool SetWatchEvent(TraceSubscriber* subscriber, |
| 79 const char* category_name, |
| 80 const char* event_name, |
| 81 int num_occurrences) = 0; |
| 82 |
| 83 // Cancel the watch event. If tracing is enabled, this may race with the |
| 84 // watch event notification firing. |
| 85 virtual bool CancelWatchEvent(TraceSubscriber* subscriber) = 0; |
| 86 |
73 // Cancel the subscriber so that it will not be called when EndTracingAsync is | 87 // Cancel the subscriber so that it will not be called when EndTracingAsync is |
74 // acked by all child processes. This will also call EndTracingAsync | 88 // acked by all child processes. This will also call EndTracingAsync |
75 // internally if necessary. | 89 // internally if necessary. |
76 // Safe to call even if caller is not the current subscriber. | 90 // Safe to call even if caller is not the current subscriber. |
77 virtual void CancelSubscriber(TraceSubscriber* subscriber) = 0; | 91 virtual void CancelSubscriber(TraceSubscriber* subscriber) = 0; |
78 | 92 |
79 protected: | 93 protected: |
80 virtual ~TraceController() {} | 94 virtual ~TraceController() {} |
81 }; | 95 }; |
82 | 96 |
83 } // namespace content | 97 } // namespace content |
84 | 98 |
85 #endif // CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ | 99 #endif // CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ |
86 | 100 |
OLD | NEW |