Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: content/browser/tracing/tracing_controller_impl.h

Issue 127703002: Add a mechanism to let TracingController invoke JavaScript via TracingUI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_TRACING_CONTROLLER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_
6 #define CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ 6 #define CONTENT_BROWSER_TRACING_TRACING_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/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "content/public/browser/tracing_controller.h" 14 #include "content/public/browser/tracing_controller.h"
15 15
16 namespace base { 16 namespace base {
17 class RefCountedString; 17 class RefCountedString;
18 } 18 }
19 19
20 namespace content { 20 namespace content {
21 21
22 class TraceMessageFilter; 22 class TraceMessageFilter;
23 class TracingUI;
23 24
24 class TracingControllerImpl : public TracingController { 25 class TracingControllerImpl : public TracingController {
25 public: 26 public:
26 static TracingControllerImpl* GetInstance(); 27 static TracingControllerImpl* GetInstance();
27 28
28 // TracingController implementation. 29 // TracingController implementation.
29 virtual bool GetCategories( 30 virtual bool GetCategories(
30 const GetCategoriesDoneCallback& callback) OVERRIDE; 31 const GetCategoriesDoneCallback& callback) OVERRIDE;
31 virtual bool EnableRecording( 32 virtual bool EnableRecording(
32 const std::string& category_filter, 33 const std::string& category_filter,
(...skipping 14 matching lines...) Expand all
47 virtual bool CaptureMonitoringSnapshot( 48 virtual bool CaptureMonitoringSnapshot(
48 const base::FilePath& result_file_path, 49 const base::FilePath& result_file_path,
49 const TracingFileResultCallback& callback) OVERRIDE; 50 const TracingFileResultCallback& callback) OVERRIDE;
50 virtual bool GetTraceBufferPercentFull( 51 virtual bool GetTraceBufferPercentFull(
51 const GetTraceBufferPercentFullCallback& callback) OVERRIDE; 52 const GetTraceBufferPercentFullCallback& callback) OVERRIDE;
52 virtual bool SetWatchEvent(const std::string& category_name, 53 virtual bool SetWatchEvent(const std::string& category_name,
53 const std::string& event_name, 54 const std::string& event_name,
54 const WatchEventCallback& callback) OVERRIDE; 55 const WatchEventCallback& callback) OVERRIDE;
55 virtual bool CancelWatchEvent() OVERRIDE; 56 virtual bool CancelWatchEvent() OVERRIDE;
56 57
58 void RegisterTracingUI(TracingUI* tracing_ui);
59 void UnregisterTracingUI(TracingUI* tracing_ui);
60
57 private: 61 private:
58 typedef std::set<scoped_refptr<TraceMessageFilter> > TraceMessageFilterSet; 62 typedef std::set<scoped_refptr<TraceMessageFilter> > TraceMessageFilterSet;
59 class ResultFile; 63 class ResultFile;
60 64
61 friend struct base::DefaultLazyInstanceTraits<TracingControllerImpl>; 65 friend struct base::DefaultLazyInstanceTraits<TracingControllerImpl>;
62 friend class TraceMessageFilter; 66 friend class TraceMessageFilter;
63 67
64 TracingControllerImpl(); 68 TracingControllerImpl();
65 virtual ~TracingControllerImpl(); 69 virtual ~TracingControllerImpl();
66 70
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void OnEnableRecordingDone(const std::string& category_filter, 133 void OnEnableRecordingDone(const std::string& category_filter,
130 int trace_options, 134 int trace_options,
131 const EnableRecordingDoneCallback& callback); 135 const EnableRecordingDoneCallback& callback);
132 void OnDisableRecordingDone(const base::FilePath& result_file_path, 136 void OnDisableRecordingDone(const base::FilePath& result_file_path,
133 const TracingFileResultCallback& callback); 137 const TracingFileResultCallback& callback);
134 void OnEnableMonitoringDone(const std::string& category_filter, 138 void OnEnableMonitoringDone(const std::string& category_filter,
135 int trace_options, 139 int trace_options,
136 const EnableMonitoringDoneCallback& callback); 140 const EnableMonitoringDoneCallback& callback);
137 void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback); 141 void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback);
138 142
143 void OnMonitoringStateChanged(bool is_monitoring);
144
139 TraceMessageFilterSet trace_message_filters_; 145 TraceMessageFilterSet trace_message_filters_;
140 146
141 // Pending acks for DisableRecording. 147 // Pending acks for DisableRecording.
142 int pending_disable_recording_ack_count_; 148 int pending_disable_recording_ack_count_;
143 TraceMessageFilterSet pending_disable_recording_filters_; 149 TraceMessageFilterSet pending_disable_recording_filters_;
144 // Pending acks for CaptureMonitoringSnapshot. 150 // Pending acks for CaptureMonitoringSnapshot.
145 int pending_capture_monitoring_snapshot_ack_count_; 151 int pending_capture_monitoring_snapshot_ack_count_;
146 TraceMessageFilterSet pending_capture_monitoring_filters_; 152 TraceMessageFilterSet pending_capture_monitoring_filters_;
147 // Pending acks for GetTraceBufferPercentFull. 153 // Pending acks for GetTraceBufferPercentFull.
148 int pending_trace_buffer_percent_full_ack_count_; 154 int pending_trace_buffer_percent_full_ack_count_;
149 TraceMessageFilterSet pending_trace_buffer_percent_full_filters_; 155 TraceMessageFilterSet pending_trace_buffer_percent_full_filters_;
150 float maximum_trace_buffer_percent_full_; 156 float maximum_trace_buffer_percent_full_;
151 157
152 bool is_recording_; 158 bool is_recording_;
153 bool is_monitoring_; 159 bool is_monitoring_;
154 160
155 GetCategoriesDoneCallback pending_get_categories_done_callback_; 161 GetCategoriesDoneCallback pending_get_categories_done_callback_;
156 TracingFileResultCallback pending_disable_recording_done_callback_; 162 TracingFileResultCallback pending_disable_recording_done_callback_;
157 TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_; 163 TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_;
158 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_; 164 GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_;
159 165
160 std::string watch_category_name_; 166 std::string watch_category_name_;
161 std::string watch_event_name_; 167 std::string watch_event_name_;
162 WatchEventCallback watch_event_callback_; 168 WatchEventCallback watch_event_callback_;
163 169
164 std::set<std::string> known_category_groups_; 170 std::set<std::string> known_category_groups_;
171 std::set<TracingUI*> tracing_uis_;
165 scoped_ptr<ResultFile> result_file_; 172 scoped_ptr<ResultFile> result_file_;
166 scoped_ptr<ResultFile> monitoring_snapshot_file_; 173 scoped_ptr<ResultFile> monitoring_snapshot_file_;
167 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl); 174 DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl);
168 }; 175 };
169 176
170 } // namespace content 177 } // namespace content
171 178
172 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_ 179 #endif // CONTENT_BROWSER_TRACING_TRACING_CONTROLLER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698