| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 WebInspector.TimelineModel.Events = { | 106 WebInspector.TimelineModel.Events = { |
| 107 RecordAdded: "RecordAdded", | 107 RecordAdded: "RecordAdded", |
| 108 RecordsCleared: "RecordsCleared", | 108 RecordsCleared: "RecordsCleared", |
| 109 RecordingStarted: "RecordingStarted", | 109 RecordingStarted: "RecordingStarted", |
| 110 RecordingStopped: "RecordingStopped", | 110 RecordingStopped: "RecordingStopped", |
| 111 RecordingProgress: "RecordingProgress", | 111 RecordingProgress: "RecordingProgress", |
| 112 RecordFilterChanged: "RecordFilterChanged" | 112 RecordFilterChanged: "RecordFilterChanged" |
| 113 } | 113 } |
| 114 | 114 |
| 115 WebInspector.TimelineModel.MainThreadName = "main"; |
| 116 |
| 115 /** | 117 /** |
| 116 * @param {!Array.<!WebInspector.TimelineModel.Record>} recordsArray | 118 * @param {!Array.<!WebInspector.TimelineModel.Record>} recordsArray |
| 117 * @param {?function(!WebInspector.TimelineModel.Record)|?function(!WebInspector
.TimelineModel.Record,number)} preOrderCallback | 119 * @param {?function(!WebInspector.TimelineModel.Record)|?function(!WebInspector
.TimelineModel.Record,number)} preOrderCallback |
| 118 * @param {function(!WebInspector.TimelineModel.Record)|function(!WebInspector.T
imelineModel.Record,number)=} postOrderCallback | 120 * @param {function(!WebInspector.TimelineModel.Record)|function(!WebInspector.T
imelineModel.Record,number)=} postOrderCallback |
| 119 * @return {boolean} | 121 * @return {boolean} |
| 120 */ | 122 */ |
| 121 WebInspector.TimelineModel.forAllRecords = function(recordsArray, preOrderCallba
ck, postOrderCallback) | 123 WebInspector.TimelineModel.forAllRecords = function(recordsArray, preOrderCallba
ck, postOrderCallback) |
| 122 { | 124 { |
| 123 /** | 125 /** |
| 124 * @param {!Array.<!WebInspector.TimelineModel.Record>} records | 126 * @param {!Array.<!WebInspector.TimelineModel.Record>} records |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 * @return {!Array.<!WebInspector.TimelineModel.Record>} | 366 * @return {!Array.<!WebInspector.TimelineModel.Record>} |
| 365 */ | 367 */ |
| 366 children: function() { }, | 368 children: function() { }, |
| 367 | 369 |
| 368 /** | 370 /** |
| 369 * @return {number} | 371 * @return {number} |
| 370 */ | 372 */ |
| 371 startTime: function() { }, | 373 startTime: function() { }, |
| 372 | 374 |
| 373 /** | 375 /** |
| 374 * @return {string|undefined} | 376 * @return {string} |
| 375 */ | 377 */ |
| 376 thread: function() { }, | 378 thread: function() { }, |
| 377 | 379 |
| 378 /** | 380 /** |
| 379 * @return {number} | 381 * @return {number} |
| 380 */ | 382 */ |
| 381 endTime: function() { }, | 383 endTime: function() { }, |
| 382 | 384 |
| 383 /** | 385 /** |
| 384 * @param {number} endTime | 386 * @param {number} endTime |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 * @constructor | 488 * @constructor |
| 487 */ | 489 */ |
| 488 WebInspector.TimelineMergingRecordBuffer.prototype = { | 490 WebInspector.TimelineMergingRecordBuffer.prototype = { |
| 489 /** | 491 /** |
| 490 * @param {string} thread | 492 * @param {string} thread |
| 491 * @param {!Array.<!WebInspector.TimelineModel.Record>} records | 493 * @param {!Array.<!WebInspector.TimelineModel.Record>} records |
| 492 * @return {!Array.<!WebInspector.TimelineModel.Record>} | 494 * @return {!Array.<!WebInspector.TimelineModel.Record>} |
| 493 */ | 495 */ |
| 494 process: function(thread, records) | 496 process: function(thread, records) |
| 495 { | 497 { |
| 496 if (thread) { | 498 if (thread !== WebInspector.TimelineModel.MainThreadName) { |
| 497 this._backgroundRecordsBuffer = this._backgroundRecordsBuffer.concat
(records); | 499 this._backgroundRecordsBuffer = this._backgroundRecordsBuffer.concat
(records); |
| 498 return []; | 500 return []; |
| 499 } | 501 } |
| 500 /** | 502 /** |
| 501 * @param {!WebInspector.TimelineModel.Record} a | 503 * @param {!WebInspector.TimelineModel.Record} a |
| 502 * @param {!WebInspector.TimelineModel.Record} b | 504 * @param {!WebInspector.TimelineModel.Record} b |
| 503 */ | 505 */ |
| 504 function recordTimestampComparator(a, b) | 506 function recordTimestampComparator(a, b) |
| 505 { | 507 { |
| 506 // Never return 0, as the merge function will squash identical entri
es. | 508 // Never return 0, as the merge function will squash identical entri
es. |
| 507 return a.startTime() < b.startTime() ? -1 : 1; | 509 return a.startTime() < b.startTime() ? -1 : 1; |
| 508 } | 510 } |
| 509 var result = this._backgroundRecordsBuffer.mergeOrdered(records, recordT
imestampComparator); | 511 var result = this._backgroundRecordsBuffer.mergeOrdered(records, recordT
imestampComparator); |
| 510 this._backgroundRecordsBuffer = []; | 512 this._backgroundRecordsBuffer = []; |
| 511 return result; | 513 return result; |
| 512 } | 514 } |
| 513 } | 515 } |
| OLD | NEW |