OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 { | 103 { |
104 var recordTypes = WebInspector.TimelineModel.RecordType; | 104 var recordTypes = WebInspector.TimelineModel.RecordType; |
105 var programRecord = record.type === recordTypes.Program ? record : null; | 105 var programRecord = record.type === recordTypes.Program ? record : null; |
106 | 106 |
107 // Start collecting main frame | 107 // Start collecting main frame |
108 if (programRecord) { | 108 if (programRecord) { |
109 if (!this._aggregatedMainThreadWork && this._findRecordRecursively(W
ebInspector.TimelineFrameModel._mainFrameMarkers, programRecord)) | 109 if (!this._aggregatedMainThreadWork && this._findRecordRecursively(W
ebInspector.TimelineFrameModel._mainFrameMarkers, programRecord)) |
110 this._aggregatedMainThreadWork = {}; | 110 this._aggregatedMainThreadWork = {}; |
111 } | 111 } |
112 | 112 |
113 var records = this._mergingBuffer.process(record.thread, programRecord ?
record.children || [] : [record]); | 113 var records; |
| 114 if (this._model.bufferEvents()) |
| 115 records = [record]; |
| 116 else |
| 117 records = this._mergingBuffer.process(record.thread, programRecord ?
record.children || [] : [record]); |
114 for (var i = 0; i < records.length; ++i) { | 118 for (var i = 0; i < records.length; ++i) { |
115 if (records[i].thread) | 119 if (records[i].thread) |
116 this._addBackgroundRecord(records[i]); | 120 this._addBackgroundRecord(records[i]); |
117 else | 121 else |
118 this._addMainThreadRecord(programRecord, records[i]); | 122 this._addMainThreadRecord(programRecord, records[i]); |
119 } | 123 } |
120 }, | 124 }, |
121 | 125 |
122 /** | 126 /** |
123 * @param {!WebInspector.TimelineModel.Record} record | 127 * @param {!WebInspector.TimelineModel.Record} record |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 this._updateCpuTime(); | 346 this._updateCpuTime(); |
343 }, | 347 }, |
344 | 348 |
345 _updateCpuTime: function() | 349 _updateCpuTime: function() |
346 { | 350 { |
347 this.cpuTime = 0; | 351 this.cpuTime = 0; |
348 for (var key in this.timeByCategory) | 352 for (var key in this.timeByCategory) |
349 this.cpuTime += this.timeByCategory[key]; | 353 this.cpuTime += this.timeByCategory[key]; |
350 } | 354 } |
351 } | 355 } |
OLD | NEW |