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_TRACE_CONTROLLER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_TRACE_CONTROLLER_IMPL_H_ |
6 #define CONTENT_BROWSER_TRACE_CONTROLLER_IMPL_H_ | 6 #define CONTENT_BROWSER_TRACE_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 29 matching lines...) Expand all Loading... |
40 const std::vector<std::string>& included_categories, | 40 const std::vector<std::string>& included_categories, |
41 const std::vector<std::string>& excluded_categories); | 41 const std::vector<std::string>& excluded_categories); |
42 | 42 |
43 // TraceController implementation: | 43 // TraceController implementation: |
44 virtual bool BeginTracing(TraceSubscriber* subscriber) OVERRIDE; | 44 virtual bool BeginTracing(TraceSubscriber* subscriber) OVERRIDE; |
45 virtual bool BeginTracing(TraceSubscriber* subscriber, | 45 virtual bool BeginTracing(TraceSubscriber* subscriber, |
46 const std::string& categories) OVERRIDE; | 46 const std::string& categories) OVERRIDE; |
47 virtual bool EndTracingAsync(TraceSubscriber* subscriber) OVERRIDE; | 47 virtual bool EndTracingAsync(TraceSubscriber* subscriber) OVERRIDE; |
48 virtual bool GetTraceBufferPercentFullAsync( | 48 virtual bool GetTraceBufferPercentFullAsync( |
49 TraceSubscriber* subscriber) OVERRIDE; | 49 TraceSubscriber* subscriber) OVERRIDE; |
| 50 bool SetWatchEvent(TraceSubscriber* subscriber, |
| 51 const char* category_name, |
| 52 const char* event_name, |
| 53 int num_occurrences); |
| 54 bool CancelWatchEvent(TraceSubscriber* subscriber); |
50 virtual void CancelSubscriber(TraceSubscriber* subscriber) OVERRIDE; | 55 virtual void CancelSubscriber(TraceSubscriber* subscriber) OVERRIDE; |
51 | 56 |
52 private: | 57 private: |
53 typedef std::set<scoped_refptr<TraceMessageFilter> > FilterMap; | 58 typedef std::set<scoped_refptr<TraceMessageFilter> > FilterMap; |
54 | 59 |
55 friend struct DefaultSingletonTraits<TraceControllerImpl>; | 60 friend struct DefaultSingletonTraits<TraceControllerImpl>; |
56 friend class ::TraceMessageFilter; | 61 friend class ::TraceMessageFilter; |
57 | 62 |
58 TraceControllerImpl(); | 63 TraceControllerImpl(); |
59 virtual ~TraceControllerImpl(); | 64 virtual ~TraceControllerImpl(); |
(...skipping 19 matching lines...) Expand all Loading... |
79 } | 84 } |
80 | 85 |
81 // Methods for use by TraceMessageFilter. | 86 // Methods for use by TraceMessageFilter. |
82 | 87 |
83 void AddFilter(TraceMessageFilter* filter); | 88 void AddFilter(TraceMessageFilter* filter); |
84 void RemoveFilter(TraceMessageFilter* filter); | 89 void RemoveFilter(TraceMessageFilter* filter); |
85 void OnTracingBegan(TraceSubscriber* subscriber); | 90 void OnTracingBegan(TraceSubscriber* subscriber); |
86 void OnEndTracingAck(const std::vector<std::string>& known_categories); | 91 void OnEndTracingAck(const std::vector<std::string>& known_categories); |
87 void OnTraceDataCollected( | 92 void OnTraceDataCollected( |
88 const scoped_refptr<base::RefCountedString>& events_str_ptr); | 93 const scoped_refptr<base::RefCountedString>& events_str_ptr); |
89 void OnTraceBufferFull(); | 94 void OnTraceNotification(int notification); |
90 void OnTraceBufferPercentFullReply(float percent_full); | 95 void OnTraceBufferPercentFullReply(float percent_full); |
91 | 96 |
92 FilterMap filters_; | 97 FilterMap filters_; |
93 TraceSubscriber* subscriber_; | 98 TraceSubscriber* subscriber_; |
94 // Pending acks for EndTracingAsync: | 99 // Pending acks for EndTracingAsync: |
95 int pending_end_ack_count_; | 100 int pending_end_ack_count_; |
96 // Pending acks for GetTraceBufferPercentFullAsync: | 101 // Pending acks for GetTraceBufferPercentFullAsync: |
97 int pending_bpf_ack_count_; | 102 int pending_bpf_ack_count_; |
98 float maximum_bpf_; | 103 float maximum_bpf_; |
99 bool is_tracing_; | 104 bool is_tracing_; |
100 bool is_get_categories_; | 105 bool is_get_categories_; |
101 std::set<std::string> known_categories_; | 106 std::set<std::string> known_categories_; |
102 std::vector<std::string> included_categories_; | 107 std::vector<std::string> included_categories_; |
103 std::vector<std::string> excluded_categories_; | 108 std::vector<std::string> excluded_categories_; |
| 109 int watch_num_occurrences_; |
| 110 std::string watch_category_; |
| 111 std::string watch_name_; |
104 | 112 |
105 DISALLOW_COPY_AND_ASSIGN(TraceControllerImpl); | 113 DISALLOW_COPY_AND_ASSIGN(TraceControllerImpl); |
106 }; | 114 }; |
107 | 115 |
108 } // namespace content | 116 } // namespace content |
109 | 117 |
110 #endif // CONTENT_BROWSER_TRACE_CONTROLLER_IMPL_H_ | 118 #endif // CONTENT_BROWSER_TRACE_CONTROLLER_IMPL_H_ |
111 | 119 |
OLD | NEW |