OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 28 matching lines...) Expand all Loading... |
39 this._dispatcher = new WebInspector.TimelineDispatcher(this); | 39 this._dispatcher = new WebInspector.TimelineDispatcher(this); |
40 this._enablementCount = 0; | 40 this._enablementCount = 0; |
41 this._jsProfilerStarted = false; | 41 this._jsProfilerStarted = false; |
42 target.timelineAgent().enable(); | 42 target.timelineAgent().enable(); |
43 } | 43 } |
44 | 44 |
45 WebInspector.TimelineManager.EventTypes = { | 45 WebInspector.TimelineManager.EventTypes = { |
46 TimelineStarted: "TimelineStarted", | 46 TimelineStarted: "TimelineStarted", |
47 TimelineStopped: "TimelineStopped", | 47 TimelineStopped: "TimelineStopped", |
48 TimelineEventRecorded: "TimelineEventRecorded", | 48 TimelineEventRecorded: "TimelineEventRecorded", |
49 TimelineAllEventsReceived: "TimelineAllEventsReceived", | |
50 TimelineProgress: "TimelineProgress" | 49 TimelineProgress: "TimelineProgress" |
51 } | 50 } |
52 | 51 |
53 WebInspector.TimelineManager.prototype = { | 52 WebInspector.TimelineManager.prototype = { |
54 /** | 53 /** |
55 * @return {boolean} | 54 * @return {boolean} |
56 */ | 55 */ |
57 isStarted: function() | 56 isStarted: function() |
58 { | 57 { |
59 return this._dispatcher.isStarted(); | 58 return this._dispatcher.isStarted(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 callback(masterError, masterProfile); | 131 callback(masterError, masterProfile); |
133 } | 132 } |
134 }, | 133 }, |
135 | 134 |
136 /** | 135 /** |
137 * @param {boolean=} consoleTimeline | 136 * @param {boolean=} consoleTimeline |
138 * @param {!Array.<!TimelineAgent.TimelineEvent>=} events | 137 * @param {!Array.<!TimelineAgent.TimelineEvent>=} events |
139 */ | 138 */ |
140 _stopped: function(consoleTimeline, events) | 139 _stopped: function(consoleTimeline, events) |
141 { | 140 { |
142 this.dispatchEventToListeners(WebInspector.TimelineManager.EventTypes.Ti
melineStopped, consoleTimeline); | 141 var data = { |
143 if (events) { | 142 consoleTimeline: consoleTimeline, |
144 for (var i = 0; i < events.length; ++i) | 143 events: events || [] |
145 this._dispatcher.eventRecorded(events[i]); | 144 }; |
146 } | 145 this.dispatchEventToListeners(WebInspector.TimelineManager.EventTypes.Ti
melineStopped, data); |
147 this.dispatchEventToListeners(WebInspector.TimelineManager.EventTypes.Ti
melineAllEventsReceived, 0); | |
148 }, | 146 }, |
149 | 147 |
150 _configureCpuProfilerSamplingInterval: function() | 148 _configureCpuProfilerSamplingInterval: function() |
151 { | 149 { |
152 var intervalUs = WebInspector.settings.highResolutionCpuProfiling.get()
? 100 : 1000; | 150 var intervalUs = WebInspector.settings.highResolutionCpuProfiling.get()
? 100 : 1000; |
153 this.target().profilerAgent().setSamplingInterval(intervalUs, didChangeI
nterval); | 151 this.target().profilerAgent().setSamplingInterval(intervalUs, didChangeI
nterval); |
154 | 152 |
155 function didChangeInterval(error) | 153 function didChangeInterval(error) |
156 { | 154 { |
157 if (error) | 155 if (error) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 }, | 211 }, |
214 | 212 |
215 /** | 213 /** |
216 * @param {number} count | 214 * @param {number} count |
217 */ | 215 */ |
218 progress: function(count) | 216 progress: function(count) |
219 { | 217 { |
220 this._manager.dispatchEventToListeners(WebInspector.TimelineManager.Even
tTypes.TimelineProgress, count); | 218 this._manager.dispatchEventToListeners(WebInspector.TimelineManager.Even
tTypes.TimelineProgress, count); |
221 } | 219 } |
222 } | 220 } |
OLD | NEW |