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

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: 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.length > 0 ? aValues[0] : 0;
mazda 2011/11/17 06:50:56 var aValue = aValues && aValues[0] || 0;
yoshiki 2011/11/17 13:00:07 Done.
199 var bvalue = bValues && bValues.length > 0 ? bValues[0] : 0;
mazda 2011/11/17 06:50:56 Ditto
yoshiki 2011/11/17 13:00:07 Done.
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 taskmanager.onTaskChange(start, length, tasks); 559 taskmanager.onTaskChange(start, length, tasks);
557 } 560 }
558 561
559 function taskRemoved(start, length) { 562 function taskRemoved(start, length) {
560 // Sometimes this can get called too early. 563 // Sometimes this can get called too early.
561 if (!taskmanager) 564 if (!taskmanager)
562 return; 565 return;
563 taskmanager.onTaskRemove(start, length); 566 taskmanager.onTaskRemove(start, length);
564 } 567 }
565 568
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