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

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
« no previous file with comments | « Source/devtools/front_end/sdk/TracingManager.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 /** 752 /**
752 * @param {!WebInspector.Event} event 753 * @param {!WebInspector.Event} event
753 */ 754 */
754 _onTracingBufferUsage: function(event) 755 _onTracingBufferUsage: function(event)
755 { 756 {
756 var usage = /** @type {number} */ (event.data); 757 var usage = /** @type {number} */ (event.data);
757 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun d(usage * 100))); 758 this._updateProgress(WebInspector.UIString("Buffer usage %d%", Math.roun d(usage * 100)));
758 }, 759 },
759 760
760 /** 761 /**
762 * @param {!WebInspector.Event} event
763 */
764 _onRetrieveEventsProgress: function(event)
765 {
766 var progress = /** @type {number} */ (event.data);
767 this._updateProgress(WebInspector.UIString("Retrieving events\u2026 %d%" , Math.round(progress * 100)));
768 },
769
770 /**
761 * @param {string} progressMessage 771 * @param {string} progressMessage
762 */ 772 */
763 _updateProgress: function(progressMessage) 773 _updateProgress: function(progressMessage)
764 { 774 {
765 if (!this._progressElement) 775 if (!this._progressElement)
766 this._showProgressPane(); 776 this._showProgressPane();
767 this._progressElement.textContent = progressMessage; 777 this._progressElement.textContent = progressMessage;
768 }, 778 },
769 779
770 _showProgressPane: function() 780 _showProgressPane: function()
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 1476
1467 WebInspector.TimelinePanelFactory.prototype = { 1477 WebInspector.TimelinePanelFactory.prototype = {
1468 /** 1478 /**
1469 * @return {!WebInspector.Panel} 1479 * @return {!WebInspector.Panel}
1470 */ 1480 */
1471 createPanel: function() 1481 createPanel: function()
1472 { 1482 {
1473 return WebInspector.TimelinePanel._instance(); 1483 return WebInspector.TimelinePanel._instance();
1474 } 1484 }
1475 } 1485 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/TracingManager.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698