| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 this.registerRequiredCSS("ui/filter.css"); | 42 this.registerRequiredCSS("ui/filter.css"); |
| 43 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f
alse); | 43 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f
alse); |
| 44 | 44 |
| 45 this._detailsLinkifier = new WebInspector.Linkifier(); | 45 this._detailsLinkifier = new WebInspector.Linkifier(); |
| 46 this._windowStartTime = 0; | 46 this._windowStartTime = 0; |
| 47 this._windowEndTime = Infinity; | 47 this._windowEndTime = Infinity; |
| 48 | 48 |
| 49 // Create model. | 49 // Create model. |
| 50 this._tracingManager = new WebInspector.TracingManager(); | 50 this._tracingManager = new WebInspector.TracingManager(); |
| 51 this._tracingManager.addEventListener(WebInspector.TracingManager.Events.Buf
ferUsage, this._onTracingBufferUsage, this); | 51 this._tracingManager.addEventListener(WebInspector.TracingManager.Events.Buf
ferUsage, this._onTracingBufferUsage, this); |
| 52 this._tracingManager.addEventListener(WebInspector.TracingManager.Events.Ret
rieveEventsProgress, this._onRetrieveEventsProgress, this); |
| 52 | 53 |
| 53 this._tracingModel = new WebInspector.TracingModel(); | 54 this._tracingModel = new WebInspector.TracingModel(); |
| 54 this._model = new WebInspector.TimelineModel(this._tracingManager, this._tra
cingModel, WebInspector.TimelineUIUtils.hiddenRecordsFilter()); | 55 this._model = new WebInspector.TimelineModel(this._tracingManager, this._tra
cingModel, WebInspector.TimelineUIUtils.hiddenRecordsFilter()); |
| 55 | 56 |
| 56 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); | 57 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar
ted, this._onRecordingStarted, this); |
| 57 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); | 58 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop
ped, this._onRecordingStopped, this); |
| 58 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); | 59 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare
d, this._onRecordsCleared, this); |
| 59 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC
hanged, this._refreshViews, this); | 60 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC
hanged, this._refreshViews, this); |
| 60 | 61 |
| 61 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); | 62 this._categoryFilter = new WebInspector.TimelineCategoryFilter(); |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 /** | 755 /** |
| 755 * @param {!WebInspector.Event} event | 756 * @param {!WebInspector.Event} event |
| 756 */ | 757 */ |
| 757 _onTracingBufferUsage: function(event) | 758 _onTracingBufferUsage: function(event) |
| 758 { | 759 { |
| 759 var usage = /** @type {number} */ (event.data); | 760 var usage = /** @type {number} */ (event.data); |
| 760 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun
d(usage * 100))); | 761 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun
d(usage * 100))); |
| 761 }, | 762 }, |
| 762 | 763 |
| 763 /** | 764 /** |
| 765 * @param {!WebInspector.Event} event |
| 766 */ |
| 767 _onRetrieveEventsProgress: function(event) |
| 768 { |
| 769 var progress = /** @type {number} */ (event.data); |
| 770 this._updateProgress(WebInspector.UIString("Retrieving events\u2026 %d%"
, Math.round(progress * 100))); |
| 771 }, |
| 772 |
| 773 /** |
| 764 * @param {string} progressMessage | 774 * @param {string} progressMessage |
| 765 */ | 775 */ |
| 766 _updateProgress: function(progressMessage) | 776 _updateProgress: function(progressMessage) |
| 767 { | 777 { |
| 768 if (!this._progressElement) | 778 if (!this._progressElement) |
| 769 this._showProgressPane(); | 779 this._showProgressPane(); |
| 770 this._progressElement.textContent = progressMessage; | 780 this._progressElement.textContent = progressMessage; |
| 771 }, | 781 }, |
| 772 | 782 |
| 773 _showProgressPane: function() | 783 _showProgressPane: function() |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 | 1478 |
| 1469 WebInspector.TimelinePanelFactory.prototype = { | 1479 WebInspector.TimelinePanelFactory.prototype = { |
| 1470 /** | 1480 /** |
| 1471 * @return {!WebInspector.Panel} | 1481 * @return {!WebInspector.Panel} |
| 1472 */ | 1482 */ |
| 1473 createPanel: function() | 1483 createPanel: function() |
| 1474 { | 1484 { |
| 1475 return WebInspector.TimelinePanel._instance(); | 1485 return WebInspector.TimelinePanel._instance(); |
| 1476 } | 1486 } |
| 1477 } | 1487 } |
| OLD | NEW |