Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: Source/devtools/front_end/timeline/TimelinePanel.js

Issue 722693002: DevTools: show progress when retrieving recorded trace events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698