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_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ |
6 #define CONTENT_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
14 #include "content/public/browser/trace_controller.h" | 14 #include "content/public/browser/trace_controller.h" |
15 | 15 |
16 class CommandLine; | 16 class CommandLine; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 class TraceMessageFilter; | 19 class TraceMessageFilter; |
20 | 20 |
21 class TraceControllerImpl : public TraceController { | 21 class TraceControllerImpl : public TraceController { |
22 public: | 22 public: |
23 static TraceControllerImpl* GetInstance(); | 23 static TraceControllerImpl* GetInstance(); |
24 | 24 |
25 // Called on the main thread of the browser process to initialize | |
26 // startup tracing. | |
27 void InitStartupTracing(const CommandLine& command_line); | |
28 bool is_tracing_startup() const { return is_tracing_startup_; } | |
29 | |
30 // TraceController implementation: | 25 // TraceController implementation: |
31 virtual bool BeginTracing(TraceSubscriber* subscriber, | 26 virtual bool BeginTracing(TraceSubscriber* subscriber, |
32 const std::string& category_patterns, | 27 const std::string& category_patterns, |
33 base::debug::TraceLog::Options options) OVERRIDE; | 28 base::debug::TraceLog::Options options) OVERRIDE; |
34 virtual bool EndTracingAsync(TraceSubscriber* subscriber) OVERRIDE; | 29 virtual bool EndTracingAsync(TraceSubscriber* subscriber) OVERRIDE; |
35 virtual bool GetTraceBufferPercentFullAsync( | 30 virtual bool GetTraceBufferPercentFullAsync( |
36 TraceSubscriber* subscriber) OVERRIDE; | 31 TraceSubscriber* subscriber) OVERRIDE; |
37 virtual bool SetWatchEvent(TraceSubscriber* subscriber, | 32 virtual bool SetWatchEvent(TraceSubscriber* subscriber, |
38 const std::string& category_name, | 33 const std::string& category_name, |
39 const std::string& event_name) OVERRIDE; | 34 const std::string& event_name) OVERRIDE; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 bool has_more_events); | 83 bool has_more_events); |
89 | 84 |
90 FilterMap filters_; | 85 FilterMap filters_; |
91 TraceSubscriber* subscriber_; | 86 TraceSubscriber* subscriber_; |
92 // Pending acks for EndTracingAsync: | 87 // Pending acks for EndTracingAsync: |
93 int pending_end_ack_count_; | 88 int pending_end_ack_count_; |
94 // Pending acks for GetTraceBufferPercentFullAsync: | 89 // Pending acks for GetTraceBufferPercentFullAsync: |
95 int pending_bpf_ack_count_; | 90 int pending_bpf_ack_count_; |
96 float maximum_bpf_; | 91 float maximum_bpf_; |
97 bool is_tracing_; | 92 bool is_tracing_; |
98 bool is_tracing_startup_; | |
99 bool is_get_category_groups_; | 93 bool is_get_category_groups_; |
100 std::set<std::string> known_category_groups_; | 94 std::set<std::string> known_category_groups_; |
101 std::string watch_category_; | 95 std::string watch_category_; |
102 std::string watch_name_; | 96 std::string watch_name_; |
103 base::debug::TraceLog::Options trace_options_; | 97 base::debug::TraceLog::Options trace_options_; |
104 base::debug::CategoryFilter category_filter_; | 98 base::debug::CategoryFilter category_filter_; |
105 | 99 |
106 DISALLOW_COPY_AND_ASSIGN(TraceControllerImpl); | 100 DISALLOW_COPY_AND_ASSIGN(TraceControllerImpl); |
107 }; | 101 }; |
108 | 102 |
109 } // namespace content | 103 } // namespace content |
110 | 104 |
111 #endif // CONTENT_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ | 105 #endif // CONTENT_BROWSER_TRACING_TRACE_CONTROLLER_IMPL_H_ |
OLD | NEW |