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 "base/debug/trace_event.h" |
8 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
9 | 10 |
10 namespace content { | 11 namespace content { |
11 | 12 |
12 class TraceSubscriber; | 13 class TraceSubscriber; |
13 | 14 |
14 // TraceController is used on the browser processes to enable/disable | 15 // TraceController is used on the browser processes to enable/disable |
15 // trace status and collect trace data. Only the browser UI thread is allowed | 16 // trace status and collect trace data. Only the browser UI thread is allowed |
16 // to interact with the TraceController object. All calls on the TraceSubscriber | 17 // to interact with the TraceController object. All calls on the TraceSubscriber |
17 // happen on the UI thread. | 18 // happen on the UI thread. |
(...skipping 10 matching lines...) Expand all Loading... |
28 // If BeginTracing was already called previously, | 29 // If BeginTracing was already called previously, |
29 // or if an EndTracingAsync is pending, | 30 // or if an EndTracingAsync is pending, |
30 // or if another subscriber is tracing, | 31 // or if another subscriber is tracing, |
31 // BeginTracing will return false meaning it failed. | 32 // BeginTracing will return false meaning it failed. |
32 // | 33 // |
33 // |categories| is a comma-delimited list of category wildcards. | 34 // |categories| is a comma-delimited list of category wildcards. |
34 // A category can have an optional '-' prefix to make it an excluded category. | 35 // A category can have an optional '-' prefix to make it an excluded category. |
35 // All the same rules apply above, so for example, having both included and | 36 // All the same rules apply above, so for example, having both included and |
36 // excluded categories in the same list would not be supported. | 37 // excluded categories in the same list would not be supported. |
37 // | 38 // |
| 39 // |mode| is the tracing mode being used. |
| 40 // |
38 // Example: BeginTracing("test_MyTest*"); | 41 // Example: BeginTracing("test_MyTest*"); |
39 // Example: BeginTracing("test_MyTest*,test_OtherStuff"); | 42 // Example: BeginTracing("test_MyTest*,test_OtherStuff"); |
40 // Example: BeginTracing("-excluded_category1,-excluded_category2"); | 43 // Example: BeginTracing("-excluded_category1,-excluded_category2"); |
41 virtual bool BeginTracing(TraceSubscriber* subscriber, | 44 virtual bool BeginTracing(TraceSubscriber* subscriber, |
42 const std::string& categories) = 0; | 45 const std::string& categories, |
| 46 base::debug::TraceLog::Options options) = 0; |
43 | 47 |
44 // Called by browser process to stop tracing events on all processes. | 48 // Called by browser process to stop tracing events on all processes. |
45 // | 49 // |
46 // Child processes typically are caching trace data and only rarely flush | 50 // Child processes typically are caching trace data and only rarely flush |
47 // and send trace data back to the browser process. That is because it may be | 51 // and send trace data back to the browser process. That is because it may be |
48 // an expensive operation to send the trace data over IPC, and we would like | 52 // an expensive operation to send the trace data over IPC, and we would like |
49 // to avoid much runtime overhead of tracing. So, to end tracing, we must | 53 // to avoid much runtime overhead of tracing. So, to end tracing, we must |
50 // asynchronously ask all child processes to flush any pending trace data. | 54 // asynchronously ask all child processes to flush any pending trace data. |
51 // | 55 // |
52 // Once all child processes have acked the EndTracing request, | 56 // Once all child processes have acked the EndTracing request, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 virtual void CancelSubscriber(TraceSubscriber* subscriber) = 0; | 89 virtual void CancelSubscriber(TraceSubscriber* subscriber) = 0; |
86 | 90 |
87 protected: | 91 protected: |
88 virtual ~TraceController() {} | 92 virtual ~TraceController() {} |
89 }; | 93 }; |
90 | 94 |
91 } // namespace content | 95 } // namespace content |
92 | 96 |
93 #endif // CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ | 97 #endif // CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ |
94 | 98 |
OLD | NEW |