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

Unified Diff: content/browser/resources/media/timeline_graph_view.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 side-by-side diff with in-line comments
Download patch
Index: content/browser/resources/media/timeline_graph_view.js
diff --git a/content/browser/resources/media/timeline_graph_view.js b/content/browser/resources/media/timeline_graph_view.js
index bb3557d995958ad08faa7d410ca2b581593b9164..89b557e1710095935eae8344d01f809035c8b75f 100644
--- a/content/browser/resources/media/timeline_graph_view.js
+++ b/content/browser/resources/media/timeline_graph_view.js
@@ -214,41 +214,8 @@ var TimelineGraphView = (function() {
* time range.
*/
drawTimeLabels: function(context, width, height, textHeight, startTime) {
- // Text for a time string to use in determining how far apart
- // to place text labels.
- var sampleText = (new Date(startTime)).toLocaleTimeString();
-
- // The desired spacing for text labels.
- var targetSpacing = context.measureText(sampleText).width +
- LABEL_LABEL_HORIZONTAL_SPACING;
-
- // The allowed time step values between adjacent labels. Anything much
- // over a couple minutes isn't terribly realistic, given how much memory
- // we use, and how slow a lot of the net-internals code is.
- var timeStepValues = [
- 1000, // 1 second
- 1000 * 5,
- 1000 * 30,
- 1000 * 60, // 1 minute
- 1000 * 60 * 5,
- 1000 * 60 * 30,
- 1000 * 60 * 60, // 1 hour
- 1000 * 60 * 60 * 5
- ];
-
- // Find smallest time step value that gives us at least |targetSpacing|,
- // if any.
- var timeStep = null;
- for (var i = 0; i < timeStepValues.length; ++i) {
- if (timeStepValues[i] / DEFAULT_SCALE >= targetSpacing) {
- timeStep = timeStepValues[i];
- break;
- }
- }
-
- // If no such value, give up.
- if (!timeStep)
- return;
+ // Draw the labels 1 minute apart.
+ var timeStep = 1000 * 60;
// Find the time for the first label. This time is a perfect multiple of
// timeStep because of how UTC times work.
« no previous file with comments | « content/browser/resources/media/stats_graph_helper.js ('k') | content/browser/resources/media/webrtc_internals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698