OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 TaskManager.prototype = { | 10 TaskManager.prototype = { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 this.selectionModel_.addEventListener('change', | 108 this.selectionModel_.addEventListener('change', |
109 this.onSelectionChange.bind(this)); | 109 this.onSelectionChange.bind(this)); |
110 | 110 |
111 // Initializes compare functions for column sort. | 111 // Initializes compare functions for column sort. |
112 var dm = this.dataModel_; | 112 var dm = this.dataModel_; |
113 // List of columns to sort by its numerical value as opposed to the | 113 // List of columns to sort by its numerical value as opposed to the |
114 // formatted value, e.g., 20480 vs. 20KB. | 114 // formatted value, e.g., 20480 vs. 20KB. |
115 var COLUMNS_SORTED_BY_VALUE = [ | 115 var COLUMNS_SORTED_BY_VALUE = [ |
116 'cpuUsage', 'physicalMemory', 'sharedMemory', 'privateMemory', | 116 'cpuUsage', 'physicalMemory', 'sharedMemory', 'privateMemory', |
117 'networkUsage', 'webCoreImageCacheSize', 'webCoreScriptsCacheSize', | 117 'networkUsage', 'webCoreImageCacheSize', 'webCoreScriptsCacheSize', |
118 'webCoreCSSCacheSize', 'fps', 'sqliteMemoryUsed', 'goatsTeleported', | 118 'webCoreCSSCacheSize', 'fps', 'videoMemory', 'sqliteMemoryUsed', |
119 'v8MemoryAllocatedSize']; | 119 'goatsTeleported', 'v8MemoryAllocatedSize']; |
120 | 120 |
121 for (var i = 0; i < DEFAULT_COLUMNS.length; i++) { | 121 for (var i = 0; i < DEFAULT_COLUMNS.length; i++) { |
122 var columnId = DEFAULT_COLUMNS[i][0]; | 122 var columnId = DEFAULT_COLUMNS[i][0]; |
123 var compareFunc = (function() { | 123 var compareFunc = (function() { |
124 var columnIdToSort = columnId; | 124 var columnIdToSort = columnId; |
125 if (COLUMNS_SORTED_BY_VALUE.indexOf(columnId) != -1) | 125 if (COLUMNS_SORTED_BY_VALUE.indexOf(columnId) != -1) |
126 columnIdToSort += 'Value'; | 126 columnIdToSort += 'Value'; |
127 | 127 |
128 return function(a, b) { | 128 return function(a, b) { |
129 var aValues = a[columnIdToSort]; | 129 var aValues = a[columnIdToSort]; |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 function init() { | 688 function init() { |
689 var params = parseQueryParams(window.location); | 689 var params = parseQueryParams(window.location); |
690 var opt = {}; | 690 var opt = {}; |
691 opt['isBackgroundMode'] = params.background; | 691 opt['isBackgroundMode'] = params.background; |
692 opt['isShowCloseButton'] = params.showclose; | 692 opt['isShowCloseButton'] = params.showclose; |
693 taskmanager.initialize(document.body, opt); | 693 taskmanager.initialize(document.body, opt); |
694 } | 694 } |
695 | 695 |
696 document.addEventListener('DOMContentLoaded', init); | 696 document.addEventListener('DOMContentLoaded', init); |
697 document.addEventListener('Close', taskmanager.onClose.bind(taskmanager)); | 697 document.addEventListener('Close', taskmanager.onClose.bind(taskmanager)); |
OLD | NEW |