| 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 "base/debug/trace_event.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // | 24 // |
| 25 // Currently only one subscriber is allowed at a time. | 25 // Currently only one subscriber is allowed at a time. |
| 26 // Tracing begins immediately locally, and asynchronously on child processes | 26 // Tracing begins immediately locally, and asynchronously on child processes |
| 27 // as soon as they receive the BeginTracing request. | 27 // as soon as they receive the BeginTracing request. |
| 28 // | 28 // |
| 29 // If BeginTracing was already called previously, | 29 // If BeginTracing was already called previously, |
| 30 // or if an EndTracingAsync is pending, | 30 // or if an EndTracingAsync is pending, |
| 31 // or if another subscriber is tracing, | 31 // or if another subscriber is tracing, |
| 32 // BeginTracing will return false meaning it failed. | 32 // BeginTracing will return false meaning it failed. |
| 33 // | 33 // |
| 34 // |categories| is a comma-delimited list of category wildcards. | 34 // |category_patterns| is a comma-delimited list of category wildcards. |
| 35 // A category can have an optional '-' prefix to make it an excluded category. | 35 // A category pattern can have an optional '-' prefix to exclude category |
| 36 // groups that contain a matching category. |
| 36 // All the same rules apply above, so for example, having both included and | 37 // All the same rules apply above, so for example, having both included and |
| 37 // excluded categories in the same list would not be supported. | 38 // excluded category patterns in the same list would not be supported. |
| 38 // | 39 // |
| 39 // |mode| is the tracing mode being used. | 40 // |mode| is the tracing mode being used. |
| 40 // | 41 // |
| 41 // Example: BeginTracing("test_MyTest*"); | 42 // Example: BeginTracing("test_MyTest*"); |
| 42 // Example: BeginTracing("test_MyTest*,test_OtherStuff"); | 43 // Example: BeginTracing("test_MyTest*,test_OtherStuff"); |
| 43 // Example: BeginTracing("-excluded_category1,-excluded_category2"); | 44 // Example: BeginTracing("-excluded_category1,-excluded_category2"); |
| 44 virtual bool BeginTracing(TraceSubscriber* subscriber, | 45 virtual bool BeginTracing(TraceSubscriber* subscriber, |
| 45 const std::string& categories, | 46 const std::string& category_patterns, |
| 46 base::debug::TraceLog::Options options) = 0; | 47 base::debug::TraceLog::Options options) = 0; |
| 47 | 48 |
| 48 // Called by browser process to stop tracing events on all processes. | 49 // Called by browser process to stop tracing events on all processes. |
| 49 // | 50 // |
| 50 // Child processes typically are caching trace data and only rarely flush | 51 // Child processes typically are caching trace data and only rarely flush |
| 51 // and send trace data back to the browser process. That is because it may be | 52 // and send trace data back to the browser process. That is because it may be |
| 52 // an expensive operation to send the trace data over IPC, and we would like | 53 // an expensive operation to send the trace data over IPC, and we would like |
| 53 // to avoid much runtime overhead of tracing. So, to end tracing, we must | 54 // to avoid much runtime overhead of tracing. So, to end tracing, we must |
| 54 // asynchronously ask all child processes to flush any pending trace data. | 55 // asynchronously ask all child processes to flush any pending trace data. |
| 55 // | 56 // |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 virtual void CancelSubscriber(TraceSubscriber* subscriber) = 0; | 90 virtual void CancelSubscriber(TraceSubscriber* subscriber) = 0; |
| 90 | 91 |
| 91 protected: | 92 protected: |
| 92 virtual ~TraceController() {} | 93 virtual ~TraceController() {} |
| 93 }; | 94 }; |
| 94 | 95 |
| 95 } // namespace content | 96 } // namespace content |
| 96 | 97 |
| 97 #endif // CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ | 98 #endif // CONTENT_PUBLIC_BROWSER_TRACE_CONTROLLER_H_ |
| 98 | 99 |
| OLD | NEW |