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

Side by Side Diff: chrome/browser/resources/memory_internals/memory_internals.js

Issue 208833003: Show time in hours, minutes and seconds in chrome://memory-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applied suggested correction Created 6 years, 9 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
« no previous file with comments | « no previous file | ui/webui/resources/js/util.js » ('j') | ui/webui/resources/js/util.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 var g_main_view = null; 5 var g_main_view = null;
6 6
7 /** 7 /**
8 * This class is the root view object of the page. 8 * This class is the root view object of the page.
9 */ 9 */
10 var MainView = (function() { 10 var MainView = (function() {
(...skipping 12 matching lines...) Expand all
23 /** 23 /**
24 * Receiving notification to display memory snapshot. 24 * Receiving notification to display memory snapshot.
25 * @param {Object} Information about memory in JSON format. 25 * @param {Object} Information about memory in JSON format.
26 */ 26 */
27 onSetSnapshot: function(browser) { 27 onSetSnapshot: function(browser) {
28 $('json').textContent = JSON.stringify(browser); 28 $('json').textContent = JSON.stringify(browser);
29 $('json').style.display = 'block'; 29 $('json').style.display = 'block';
30 30
31 $('os-value').textContent = browser['os'] + ' (' + 31 $('os-value').textContent = browser['os'] + ' (' +
32 browser['os_version'] + ')'; 32 browser['os_version'] + ')';
33 $('uptime-value').textContent = Math.floor(browser['uptime'] / 1000) + 33 $('uptime-value').textContent =
34 ' sec'; 34 secondsToHMS(Math.floor(browser['uptime'] / 1000));
35 35
36 this.updateSnapshot(browser['processes']); 36 this.updateSnapshot(browser['processes']);
37 this.updateExtensions(browser['extensions']); 37 this.updateExtensions(browser['extensions']);
38 }, 38 },
39 39
40 /** 40 /**
41 * Update process information table. 41 * Update process information table.
42 * @param {Object} processes information about memory. 42 * @param {Object} processes information about memory.
43 */ 43 */
44 updateSnapshot: function(processes) { 44 updateSnapshot: function(processes) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 } 130 }
131 }; 131 };
132 132
133 function JoinLinks(tab) { 133 function JoinLinks(tab) {
134 var line = ''; 134 var line = '';
135 for (var l in tab['history']) { 135 for (var l in tab['history']) {
136 var history = tab['history'][l]; 136 var history = tab['history'][l];
137 var title = (history['title'] == '') ? history['url'] : history['title']; 137 var title = (history['title'] == '') ? history['url'] : history['title'];
138 var url = '<a href="' + history['url'] + '">' + HTMLEscape(title) + 138 var url = '<a href="' + history['url'] + '">' + HTMLEscape(title) +
139 '</a> (' + history['time'] + ' sec. ago)'; 139 '</a> (' + secondsToHMS(history['time']) + ' ago)';
140 if (l == tab['index']) { 140 if (l == tab['index']) {
141 url = '<strong>' + url + '</strong>'; 141 url = '<strong>' + url + '</strong>';
142 } 142 }
143 line += '<dd>' + url; 143 line += '<dd>' + url;
144 } 144 }
145 return line; 145 return line;
146 }; 146 };
147 147
148 return MainView; 148 return MainView;
149 })(); 149 })();
150 150
151 /** 151 /**
152 * Initialize everything once we have access to chrome://memory-internals. 152 * Initialize everything once we have access to chrome://memory-internals.
153 */ 153 */
154 document.addEventListener('DOMContentLoaded', function() { 154 document.addEventListener('DOMContentLoaded', function() {
155 g_main_view = new MainView(); 155 g_main_view = new MainView();
156 }); 156 });
OLDNEW
« no previous file with comments | « no previous file | ui/webui/resources/js/util.js » ('j') | ui/webui/resources/js/util.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698