| 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 12 matching lines...) Expand all Loading... |
| 23 // | 23 // |
| 24 // Currently only one subscriber is allowed at a time. | 24 // Currently only one subscriber is allowed at a time. |
| 25 // Tracing begins immediately locally, and asynchronously on child processes | 25 // Tracing begins immediately locally, and asynchronously on child processes |
| 26 // as soon as they receive the BeginTracing request. | 26 // as soon as they receive the BeginTracing request. |
| 27 // | 27 // |
| 28 // If BeginTracing was already called previously, | 28 // If BeginTracing was already called previously, |
| 29 // or if an EndTracingAsync is pending, | 29 // or if an EndTracingAsync is pending, |
| 30 // or if another subscriber is tracing, | 30 // or if another subscriber is tracing, |
| 31 // BeginTracing will return false meaning it failed. | 31 // BeginTracing will return false meaning it failed. |
| 32 // | 32 // |
| 33 // |categories| is a comma-delimited list of category wildcards. | 33 // |category_patterns| is a comma-delimited list of category wildcards. |
| 34 // A category can have an optional '-' prefix to make it an excluded category. | 34 // A category pattern can have an optional '-' prefix to exclude category |
| 35 // groups that contain a matching 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 category_patterns in the same list would not be supported. |
| 37 // | 38 // |
| 38 // Example: BeginTracing("test_MyTest*"); | 39 // Example: BeginTracing("test_MyTest*"); |
| 39 // Example: BeginTracing("test_MyTest*,test_OtherStuff"); | 40 // Example: BeginTracing("test_MyTest*,test_OtherStuff"); |
| 40 // Example: BeginTracing("-excluded_category1,-excluded_category2"); | 41 // Example: BeginTracing("-excluded_category1,-excluded_category2"); |
| 41 virtual bool BeginTracing(TraceSubscriber* subscriber, | 42 virtual bool BeginTracing(TraceSubscriber* subscriber, |
| 42 const std::string& categories) = 0; | 43 const std::string& category_patterns) = 0; |
| 43 | 44 |
| 44 // Called by browser process to stop tracing events on all processes. | 45 // Called by browser process to stop tracing events on all processes. |
| 45 // | 46 // |
| 46 // Child processes typically are caching trace data and only rarely flush | 47 // 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 | 48 // 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 | 49 // 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 | 50 // 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. | 51 // asynchronously ask all child processes to flush any pending trace data. |
| 51 // | 52 // |
| 52 // Once all child processes have acked the EndTracing request, | 53 // 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; | 86 virtual void CancelSubscriber(TraceSubscriber* subscriber) = 0; |
| 86 | 87 |
| 87 protected: | 88 protected: |
| 88 virtual ~TraceController() {} | 89 virtual ~TraceController() {} |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 } // namespace content | 92 } // namespace content |
| 92 | 93 |
| 93 #endif // CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ | 94 #endif // CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ |
| 94 | 95 |
| OLD | NEW |