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.TargetAwareObject} | 9 * @extends {WebInspector.TargetAwareObject} |
10 */ | 10 */ |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 * @param {!WebInspector.TracingModel.EventPayload} payload | 178 * @param {!WebInspector.TracingModel.EventPayload} payload |
179 */ | 179 */ |
180 _addEvent: function(payload) | 180 _addEvent: function(payload) |
181 { | 181 { |
182 var process = this._processById[payload.pid]; | 182 var process = this._processById[payload.pid]; |
183 if (!process) { | 183 if (!process) { |
184 process = new WebInspector.TracingModel.Process(payload.pid); | 184 process = new WebInspector.TracingModel.Process(payload.pid); |
185 this._processById[payload.pid] = process; | 185 this._processById[payload.pid] = process; |
186 } | 186 } |
187 var thread = process.threadById(payload.tid); | 187 var thread = process.threadById(payload.tid); |
188 if (payload.ph === WebInspector.TracingModel.Phase.SnapshotObject) { | |
189 var event = thread.addEvent(payload); | |
190 process.addObject(event); | |
191 return; | |
192 } | |
193 if (payload.ph !== WebInspector.TracingModel.Phase.Metadata) { | 188 if (payload.ph !== WebInspector.TracingModel.Phase.Metadata) { |
194 var timestamp = payload.ts / 1000; | 189 var timestamp = payload.ts / 1000; |
195 // We do allow records for unrelated threads to arrive out-of-order, | 190 // We do allow records for unrelated threads to arrive out-of-order, |
196 // so there's a chance we're getting records from the past. | 191 // so there's a chance we're getting records from the past. |
197 if (timestamp && (!this._minimumRecordTime || timestamp < this._mini
mumRecordTime)) | 192 if (timestamp && (!this._minimumRecordTime || timestamp < this._mini
mumRecordTime)) |
198 this._minimumRecordTime = timestamp; | 193 this._minimumRecordTime = timestamp; |
199 if (!this._maximumRecordTime || timestamp > this._maximumRecordTime) | 194 if (!this._maximumRecordTime || timestamp > this._maximumRecordTime) |
200 this._maximumRecordTime = timestamp; | 195 this._maximumRecordTime = timestamp; |
201 var event = thread.addEvent(payload); | 196 var event = thread.addEvent(payload); |
| 197 if (payload.ph === WebInspector.TracingModel.Phase.SnapshotObject) |
| 198 process.addObject(event); |
202 if (event && event.name === WebInspector.TracingModel.DevToolsMetada
taEvent.TracingStartedInPage && | 199 if (event && event.name === WebInspector.TracingModel.DevToolsMetada
taEvent.TracingStartedInPage && |
203 event.category === WebInspector.TracingModel.DevToolsMetadataEve
ntCategory && | 200 event.category === WebInspector.TracingModel.DevToolsMetadataEve
ntCategory && |
204 event.args["sessionId"] === this._sessionId) | 201 event.args["sessionId"] === this._sessionId) |
205 this._devtoolsMetadataEvents.push(event); | 202 this._devtoolsMetadataEvents.push(event); |
206 return; | 203 return; |
207 } | 204 } |
208 switch (payload.name) { | 205 switch (payload.name) { |
209 case WebInspector.TracingModel.MetadataEvent.ProcessSortIndex: | 206 case WebInspector.TracingModel.MetadataEvent.ProcessSortIndex: |
210 process._setSortIndex(payload.args["sort_index"]); | 207 process._setSortIndex(payload.args["sort_index"]); |
211 break; | 208 break; |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 dataCollected: function(data) | 549 dataCollected: function(data) |
553 { | 550 { |
554 this._tracingModel._eventsCollected(data); | 551 this._tracingModel._eventsCollected(data); |
555 }, | 552 }, |
556 | 553 |
557 tracingComplete: function() | 554 tracingComplete: function() |
558 { | 555 { |
559 this._tracingModel._tracingComplete(); | 556 this._tracingModel._tracingComplete(); |
560 } | 557 } |
561 } | 558 } |
OLD | NEW |