| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 ]; | 369 ]; |
| 370 | 370 |
| 371 WebInspector.TracingTimelineFrameModel.prototype = { | 371 WebInspector.TracingTimelineFrameModel.prototype = { |
| 372 /** | 372 /** |
| 373 * @param {!Array.<!WebInspector.TracingModel.Event>} events | 373 * @param {!Array.<!WebInspector.TracingModel.Event>} events |
| 374 * @param {string} sessionId | 374 * @param {string} sessionId |
| 375 */ | 375 */ |
| 376 addTraceEvents: function(events, sessionId) | 376 addTraceEvents: function(events, sessionId) |
| 377 { | 377 { |
| 378 this._sessionId = sessionId; | 378 this._sessionId = sessionId; |
| 379 if (!events.length) |
| 380 return; |
| 381 if (events[0].startTime < this._minimumRecordTime) |
| 382 this._minimumRecordTime = events[0].startTime; |
| 379 for (var i = 0; i < events.length; ++i) | 383 for (var i = 0; i < events.length; ++i) |
| 380 this._addTraceEvent(events[i]); | 384 this._addTraceEvent(events[i]); |
| 381 }, | 385 }, |
| 382 | 386 |
| 383 /** | 387 /** |
| 384 * @param {!WebInspector.TracingModel.Event} event | 388 * @param {!WebInspector.TracingModel.Event} event |
| 385 */ | 389 */ |
| 386 _addTraceEvent: function(event) | 390 _addTraceEvent: function(event) |
| 387 { | 391 { |
| 388 var eventNames = WebInspector.TracingTimelineModel.RecordType; | 392 var eventNames = WebInspector.TracingTimelineModel.RecordType; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 /** | 560 /** |
| 557 * @param {string} category | 561 * @param {string} category |
| 558 * @param {number} time | 562 * @param {number} time |
| 559 */ | 563 */ |
| 560 _addTimeForCategory: function(category, time) | 564 _addTimeForCategory: function(category, time) |
| 561 { | 565 { |
| 562 this.timeByCategory[category] = (this.timeByCategory[category] || 0) + t
ime; | 566 this.timeByCategory[category] = (this.timeByCategory[category] || 0) + t
ime; |
| 563 this.cpuTime += time; | 567 this.cpuTime += time; |
| 564 }, | 568 }, |
| 565 } | 569 } |
| OLD | NEW |