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

Side by Side Diff: chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.js

Issue 191143002: Added process title to Process Monitor Sample Extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html ('k') | 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) 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 // Shows an updating list of process statistics. 5 // Shows an updating list of process statistics.
6 function init() { 6 function init() {
7 chrome.processes.onUpdatedWithMemory.addListener( 7 chrome.processes.onUpdatedWithMemory.addListener(
8 function(processes) { 8 function(processes) {
9 var table = "<table>\n" + 9 var table = "<table>\n" +
10 "<tr><td><b>Process</b></td>" + 10 "<tr><td><b>Process</b></td>" +
11 "<td>OS ID</td>" + 11 "<td>OS ID</td>" +
12 "<td>Title</td>" +
12 "<td>Type</td>" + 13 "<td>Type</td>" +
13 "<td>Tabs</td>" + 14 "<td>Tabs</td>" +
14 "<td>CPU</td>" + 15 "<td>CPU</td>" +
15 "<td>Network</td>" + 16 "<td>Network</td>" +
16 "<td>Private Memory</td>" + 17 "<td>Private Memory</td>" +
17 "<td>FPS</td>" + 18 "<td>FPS</td>" +
18 "<td>JS Memory</td>" + 19 "<td>JS Memory</td>" +
19 "<td></td>" + 20 "<td></td>" +
20 "</tr>\n"; 21 "</tr>\n";
21 for (pid in processes) { 22 for (pid in processes) {
(...skipping 17 matching lines...) Expand all
39 network = (network / 1024).toFixed(1) + " kB/s"; 40 network = (network / 1024).toFixed(1) + " kB/s";
40 } else if (network > 0) { 41 } else if (network > 0) {
41 network += " B/s"; 42 network += " B/s";
42 } else if (network == -1) { 43 } else if (network == -1) {
43 network = "N/A"; 44 network = "N/A";
44 } 45 }
45 46
46 table += 47 table +=
47 "<tr><td>" + process.id + "</td>" + 48 "<tr><td>" + process.id + "</td>" +
48 "<td>" + process.osProcessId + "</td>" + 49 "<td>" + process.osProcessId + "</td>" +
50 "<td>" + process.title + "</td>" +
49 "<td>" + process.type + "</td>" + 51 "<td>" + process.type + "</td>" +
50 "<td>" + process.tabs + "</td>" + 52 "<td>" + process.tabs + "</td>" +
51 "<td>" + process.cpu + "</td>" + 53 "<td>" + process.cpu + "</td>" +
52 "<td>" + network + "</td>"; 54 "<td>" + network + "</td>";
53 55
54 if ("privateMemory" in process) { 56 if ("privateMemory" in process) {
55 table += "<td>" + (process.privateMemory / 1024) + "K</td>"; 57 table += "<td>" + (process.privateMemory / 1024) + "K</td>";
56 } else { 58 } else {
57 table += "<td>N/A</td>"; 59 table += "<td>N/A</td>";
58 } 60 }
(...skipping 12 matching lines...) Expand all
71 table += "<td>N/A</td>"; 73 table += "<td>N/A</td>";
72 } 74 }
73 75
74 table += 76 table +=
75 "<td></td>" + 77 "<td></td>" +
76 "</tr>\n"; 78 "</tr>\n";
77 return table; 79 return table;
78 } 80 }
79 81
80 document.addEventListener('DOMContentLoaded', init); 82 document.addEventListener('DOMContentLoaded', init);
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/examples/api/processes/process_monitor/popup.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698