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

Side by Side Diff: content/browser/resources/media/stats_graph_helper.js

Issue 14880002: Fixes a memory leak when running webrtc-internals for a long time, by using a circular buffer of si… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge conflict Created 7 years, 7 months 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // 5 //
6 // This file contains helper methods to draw the stats timeline graphs. 6 // This file contains helper methods to draw the stats timeline graphs.
7 // Each graph represents a series of stats report for a PeerConnection, 7 // Each graph represents a series of stats report for a PeerConnection,
8 // e.g. 1234-0-ssrc-abcd123-bytesSent is the graph for the series of bytesSent 8 // e.g. 1234-0-ssrc-abcd123-bytesSent is the graph for the series of bytesSent
9 // for ssrc-abcd123 of PeerConnection 0 in process 1234. 9 // for ssrc-abcd123 of PeerConnection 0 in process 1234.
10 // The graphs are drawn as CANVAS, grouped per report type per PeerConnection. 10 // The graphs are drawn as CANVAS, grouped per report type per PeerConnection.
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 graphViews[graphViewId] = createStatsGraphView(peerConnectionElement, 133 graphViews[graphViewId] = createStatsGraphView(peerConnectionElement,
134 report, 134 report,
135 graphType); 135 graphType);
136 var date = new Date(stats.timestamp); 136 var date = new Date(stats.timestamp);
137 graphViews[graphViewId].setDateRange(date, date); 137 graphViews[graphViewId].setDateRange(date, date);
138 } 138 }
139 // Adds the new dataSeries to the graphView. We have to do it here to cover 139 // Adds the new dataSeries to the graphView. We have to do it here to cover
140 // both the simple and compound graph cases. 140 // both the simple and compound graph cases.
141 if (!graphViews[graphViewId].hasDataSeries(dataSeries[finalDataSeriesId])) 141 if (!graphViews[graphViewId].hasDataSeries(dataSeries[finalDataSeriesId]))
142 graphViews[graphViewId].addDataSeries(dataSeries[finalDataSeriesId]); 142 graphViews[graphViewId].addDataSeries(dataSeries[finalDataSeriesId]);
143
143 graphViews[graphViewId].updateEndDate(); 144 graphViews[graphViewId].updateEndDate();
144 } 145 }
145 } 146 }
146 147
147 // Makes sure the TimelineDataSeries with id |dataSeriesId| is created, 148 // Makes sure the TimelineDataSeries with id |dataSeriesId| is created,
148 // and adds the new data point to it. 149 // and adds the new data point to it.
149 function addDataSeriesPoint(dataSeriesId, time, label, value) { 150 function addDataSeriesPoint(dataSeriesId, time, label, value) {
150 if (!dataSeries[dataSeriesId]) { 151 if (!dataSeries[dataSeriesId]) {
151 dataSeries[dataSeriesId] = new TimelineDataSeries(); 152 dataSeries[dataSeriesId] = new TimelineDataSeries();
152 if (bweCompoundGraphConfig[label]) { 153 if (bweCompoundGraphConfig[label]) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 div.graphViewId = 225 div.graphViewId =
225 peerConnectionElement.id + '-' + reportName + '-bweCompound'; 226 peerConnectionElement.id + '-' + reportName + '-bweCompound';
226 div.firstChild.addEventListener('click', function(event) { 227 div.firstChild.addEventListener('click', function(event) {
227 var target = dataSeries[event.target.parentNode.dataSeriesId]; 228 var target = dataSeries[event.target.parentNode.dataSeriesId];
228 target.show(event.target.checked); 229 target.show(event.target.checked);
229 graphViews[event.target.parentNode.graphViewId].repaint(); 230 graphViews[event.target.parentNode.graphViewId].repaint();
230 }); 231 });
231 } 232 }
232 return legend; 233 return legend;
233 } 234 }
OLDNEW
« no previous file with comments | « content/browser/resources/media/data_series.js ('k') | content/browser/resources/media/timeline_graph_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698