OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * @constructor | 8 * @constructor |
9 * @extends {WebInspector.SDKObject} | 9 * @extends {WebInspector.SDKObject} |
10 */ | 10 */ |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 WebInspector.TracingModel.DevToolsMetadataEvent = { | 75 WebInspector.TracingModel.DevToolsMetadataEvent = { |
76 TracingStartedInPage: "TracingStartedInPage", | 76 TracingStartedInPage: "TracingStartedInPage", |
77 TracingStartedInWorker: "TracingStartedInWorker", | 77 TracingStartedInWorker: "TracingStartedInWorker", |
78 }; | 78 }; |
79 | 79 |
80 WebInspector.TracingModel.prototype = { | 80 WebInspector.TracingModel.prototype = { |
81 /** | 81 /** |
82 * @return {!Array.<!WebInspector.TracingModel.Event>} | 82 * @return {!Array.<!WebInspector.TracingModel.Event>} |
83 */ | 83 */ |
84 devtoolsMetadataEvents: function() | 84 devtoolsPageMetadataEvents: function() |
85 { | 85 { |
86 return this._devtoolsMetadataEvents; | 86 return this._devtoolsPageMetadataEvents; |
87 }, | 87 }, |
88 | 88 |
89 /** | 89 /** |
| 90 * @return {!Array.<!WebInspector.TracingModel.Event>} |
| 91 */ |
| 92 devtoolsWorkerMetadataEvents: function() |
| 93 { |
| 94 return this._devtoolsWorkerMetadataEvents; |
| 95 }, |
| 96 |
| 97 /** |
90 * @param {string} categoryFilter | 98 * @param {string} categoryFilter |
91 * @param {string} options | 99 * @param {string} options |
92 * @param {function(?string)=} callback | 100 * @param {function(?string)=} callback |
93 */ | 101 */ |
94 start: function(categoryFilter, options, callback) | 102 start: function(categoryFilter, options, callback) |
95 { | 103 { |
96 this.target().profilingLock.acquire(); | 104 this.target().profilingLock.acquire(); |
97 this.reset(); | 105 this.reset(); |
98 var bufferUsageReportingIntervalMs = 500; | 106 var bufferUsageReportingIntervalMs = 500; |
99 TracingAgent.start(categoryFilter, options, bufferUsageReportingInterval
Ms, callback); | 107 TracingAgent.start(categoryFilter, options, bufferUsageReportingInterval
Ms, callback); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 this.dispatchEventToListeners(WebInspector.TracingModel.Events.TracingSt
opped); | 176 this.dispatchEventToListeners(WebInspector.TracingModel.Events.TracingSt
opped); |
169 this._active = false; | 177 this._active = false; |
170 }, | 178 }, |
171 | 179 |
172 reset: function() | 180 reset: function() |
173 { | 181 { |
174 this._processById = {}; | 182 this._processById = {}; |
175 this._minimumRecordTime = 0; | 183 this._minimumRecordTime = 0; |
176 this._maximumRecordTime = 0; | 184 this._maximumRecordTime = 0; |
177 this._sessionId = null; | 185 this._sessionId = null; |
178 this._devtoolsMetadataEvents = []; | 186 this._devtoolsPageMetadataEvents = []; |
| 187 this._devtoolsWorkerMetadataEvents = []; |
179 this._rawEvents = []; | 188 this._rawEvents = []; |
180 }, | 189 }, |
181 | 190 |
182 /** | 191 /** |
183 * @return {!Array.<!WebInspector.TracingModel.EventPayload>} | 192 * @return {!Array.<!WebInspector.TracingModel.EventPayload>} |
184 */ | 193 */ |
185 rawEvents: function() | 194 rawEvents: function() |
186 { | 195 { |
187 return this._rawEvents; | 196 return this._rawEvents; |
188 }, | 197 }, |
(...skipping 16 matching lines...) Expand all Loading... |
205 if (timestamp && (!this._minimumRecordTime || timestamp < this._mini
mumRecordTime)) | 214 if (timestamp && (!this._minimumRecordTime || timestamp < this._mini
mumRecordTime)) |
206 this._minimumRecordTime = timestamp; | 215 this._minimumRecordTime = timestamp; |
207 if (!this._maximumRecordTime || timestamp > this._maximumRecordTime) | 216 if (!this._maximumRecordTime || timestamp > this._maximumRecordTime) |
208 this._maximumRecordTime = timestamp; | 217 this._maximumRecordTime = timestamp; |
209 var event = thread.addEvent(payload); | 218 var event = thread.addEvent(payload); |
210 if (payload.ph === WebInspector.TracingModel.Phase.SnapshotObject) | 219 if (payload.ph === WebInspector.TracingModel.Phase.SnapshotObject) |
211 process.addObject(event); | 220 process.addObject(event); |
212 if (event && event.name === WebInspector.TracingModel.DevToolsMetada
taEvent.TracingStartedInPage && | 221 if (event && event.name === WebInspector.TracingModel.DevToolsMetada
taEvent.TracingStartedInPage && |
213 event.category === WebInspector.TracingModel.DevToolsMetadataEve
ntCategory && | 222 event.category === WebInspector.TracingModel.DevToolsMetadataEve
ntCategory && |
214 event.args["sessionId"] === this._sessionId) | 223 event.args["sessionId"] === this._sessionId) |
215 this._devtoolsMetadataEvents.push(event); | 224 this._devtoolsPageMetadataEvents.push(event); |
| 225 if (event && event.name === WebInspector.TracingModel.DevToolsMetada
taEvent.TracingStartedInWorker && |
| 226 event.category === WebInspector.TracingModel.DevToolsMetadataEve
ntCategory && |
| 227 event.args["sessionId"] === this._sessionId) |
| 228 this._devtoolsWorkerMetadataEvents.push(event); |
216 return; | 229 return; |
217 } | 230 } |
218 switch (payload.name) { | 231 switch (payload.name) { |
219 case WebInspector.TracingModel.MetadataEvent.ProcessSortIndex: | 232 case WebInspector.TracingModel.MetadataEvent.ProcessSortIndex: |
220 process._setSortIndex(payload.args["sort_index"]); | 233 process._setSortIndex(payload.args["sort_index"]); |
221 break; | 234 break; |
222 case WebInspector.TracingModel.MetadataEvent.ProcessName: | 235 case WebInspector.TracingModel.MetadataEvent.ProcessName: |
223 process._setName(payload.args["name"]); | 236 process._setName(payload.args["name"]); |
224 break; | 237 break; |
225 case WebInspector.TracingModel.MetadataEvent.ThreadSortIndex: | 238 case WebInspector.TracingModel.MetadataEvent.ThreadSortIndex: |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 started: function(consoleTimeline, sessionId) | 676 started: function(consoleTimeline, sessionId) |
664 { | 677 { |
665 this._tracingModel._tracingStarted(sessionId); | 678 this._tracingModel._tracingStarted(sessionId); |
666 }, | 679 }, |
667 | 680 |
668 stopped: function() | 681 stopped: function() |
669 { | 682 { |
670 this._tracingModel._onStop(); | 683 this._tracingModel._onStop(); |
671 } | 684 } |
672 } | 685 } |
OLD | NEW |