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

Side by Side Diff: chrome/browser/resources/task_manager/main.js

Issue 8486014: WebUI TaskManager: Make sort rows including "N/A" correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 /** @constructor */ 5 /** @constructor */
6 function TaskManager() { } 6 function TaskManager() { }
7 7
8 cr.addSingletonGetter(TaskManager); 8 cr.addSingletonGetter(TaskManager);
9 9
10 /* 10 /*
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 'cpuUsage', 'physicalMemory', 'sharedMemory', 'privateMemory', 186 'cpuUsage', 'physicalMemory', 'sharedMemory', 'privateMemory',
187 'networkUsage', 'webCoreImageCacheSize', 'webCoreScriptsCacheSize', 187 'networkUsage', 'webCoreImageCacheSize', 'webCoreScriptsCacheSize',
188 'webCoreCSSCacheSize', 'fps', 'sqliteMemoryUsed', 'goatsTeleported', 188 'webCoreCSSCacheSize', 'fps', 'sqliteMemoryUsed', 'goatsTeleported',
189 'v8MemoryAllocatedSize']; 189 'v8MemoryAllocatedSize'];
190 190
191 for (var i in columns_sorted_by_value) { 191 for (var i in columns_sorted_by_value) {
192 var column_id = columns_sorted_by_value[i]; 192 var column_id = columns_sorted_by_value[i];
193 var compare_func = function() { 193 var compare_func = function() {
194 var value_id = column_id + 'Value'; 194 var value_id = column_id + 'Value';
195 return function(a, b) { 195 return function(a, b) {
196 return dm.defaultValuesCompareFunction(a[value_id][0], 196 var aValues = a[value_id];
197 b[value_id][0]); 197 var bValues = b[value_id];
198 var aValue = aValues && aValues[0] || 0;
199 var bvalue = bValues && bValues[0] || 0;
200 return dm.defaultValuesCompareFunction(aValue, bvalue);
198 }; 201 };
199 }(); 202 }();
200 dm.setCompareFunction(column_id, compare_func); 203 dm.setCompareFunction(column_id, compare_func);
201 } 204 }
202 205
203 var ary = this.dialogDom_.querySelectorAll('[visibleif]'); 206 var ary = this.dialogDom_.querySelectorAll('[visibleif]');
204 for (var i = 0; i < ary.length; i++) { 207 for (var i = 0; i < ary.length; i++) {
205 var expr = ary[i].getAttribute('visibleif'); 208 var expr = ary[i].getAttribute('visibleif');
206 if (!eval(expr)) 209 if (!eval(expr))
207 ary[i].hidden = true; 210 ary[i].hidden = true;
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 taskmanager.onTaskChange(start, length, tasks); 562 taskmanager.onTaskChange(start, length, tasks);
560 } 563 }
561 564
562 function taskRemoved(start, length) { 565 function taskRemoved(start, length) {
563 // Sometimes this can get called too early. 566 // Sometimes this can get called too early.
564 if (!taskmanager) 567 if (!taskmanager)
565 return; 568 return;
566 taskmanager.onTaskRemove(start, length); 569 taskmanager.onTaskRemove(start, length);
567 } 570 }
568 571
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698