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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class FilePath; | 15 class FilePath; |
16 }; | 16 }; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class TracingController; | 20 class TracingController; |
21 class TracingUI; | |
21 | 22 |
22 // TracingController is used on the browser processes to enable/disable | 23 // TracingController is used on the browser processes to enable/disable |
23 // trace status and collect trace data. Only the browser UI thread is allowed | 24 // trace status and collect trace data. Only the browser UI thread is allowed |
24 // to interact with the TracingController object. All callbacks are called on | 25 // to interact with the TracingController object. All callbacks are called on |
25 // the UI thread. | 26 // the UI thread. |
26 class TracingController { | 27 class TracingController { |
27 public: | 28 public: |
28 enum Options { | 29 enum Options { |
29 DEFAULT_OPTIONS = 0, | 30 DEFAULT_OPTIONS = 0, |
30 ENABLE_SYSTRACE = 1 << 0, | 31 ENABLE_SYSTRACE = 1 << 0, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 // process. | 155 // process. |
155 typedef base::Callback<void()> WatchEventCallback; | 156 typedef base::Callback<void()> WatchEventCallback; |
156 virtual bool SetWatchEvent(const std::string& category_name, | 157 virtual bool SetWatchEvent(const std::string& category_name, |
157 const std::string& event_name, | 158 const std::string& event_name, |
158 const WatchEventCallback& callback) = 0; | 159 const WatchEventCallback& callback) = 0; |
159 | 160 |
160 // Cancel the watch event. If tracing is enabled, this may race with the | 161 // Cancel the watch event. If tracing is enabled, this may race with the |
161 // watch event callback. | 162 // watch event callback. |
162 virtual bool CancelWatchEvent() = 0; | 163 virtual bool CancelWatchEvent() = 0; |
163 | 164 |
165 // Regsiter/Unregister tracing UI that is using this TracingController. | |
dsinclair
2014/01/08 15:57:27
nit: s/Regsiter/Register
| |
166 virtual void RegisterTracingUI(TracingUI* tracing_ui) = 0; | |
167 virtual void UnregisterTracingUI(TracingUI* tracing_ui) = 0; | |
168 | |
164 protected: | 169 protected: |
165 virtual ~TracingController() {} | 170 virtual ~TracingController() {} |
166 }; | 171 }; |
167 | 172 |
168 } // namespace content | 173 } // namespace content |
169 | 174 |
170 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ | 175 #endif // CONTENT_PUBLIC_BROWSER_TRACING_CONTROLLER_H_ |
OLD | NEW |