OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TRACING_CONTROLLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // set beforehand in case of key collision. | 127 // set beforehand in case of key collision. |
128 virtual void AddMetadata(const base::DictionaryValue& metadata) = 0; | 128 virtual void AddMetadata(const base::DictionaryValue& metadata) = 0; |
129 | 129 |
130 // Get the maximum across processes of trace buffer percent full state. | 130 // Get the maximum across processes of trace buffer percent full state. |
131 // When the TraceBufferUsage value is determined, the callback is | 131 // When the TraceBufferUsage value is determined, the callback is |
132 // called. | 132 // called. |
133 typedef base::Callback<void(float, size_t)> GetTraceBufferUsageCallback; | 133 typedef base::Callback<void(float, size_t)> GetTraceBufferUsageCallback; |
134 virtual bool GetTraceBufferUsage( | 134 virtual bool GetTraceBufferUsage( |
135 const GetTraceBufferUsageCallback& callback) = 0; | 135 const GetTraceBufferUsageCallback& callback) = 0; |
136 | 136 |
137 // |callback| will will be called every time the given event occurs on any | |
138 // process. | |
139 typedef base::Callback<void()> WatchEventCallback; | |
140 virtual bool SetWatchEvent(const std::string& category_name, | |
141 const std::string& event_name, | |
142 const WatchEventCallback& callback) = 0; | |
143 | |
144 // Cancel the watch event. If tracing is enabled, this may race with the | |
145 // watch event callback. | |
146 virtual bool CancelWatchEvent() = 0; | |
147 | |
148 // Check if the tracing system is tracing | 137 // Check if the tracing system is tracing |
149 virtual bool IsTracing() const = 0; | 138 virtual bool IsTracing() const = 0; |
150 | 139 |
151 protected: | 140 protected: |
152 virtual ~TracingController() {} | 141 virtual ~TracingController() {} |
153 }; | 142 }; |
154 | 143 |
155 } // namespace content | 144 } // namespace content |
156 | 145 |
157 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 146 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
OLD | NEW |