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

Side by Side Diff: chrome/browser/resources/gpu_internals/info_view.js

Issue 10910026: Show about:sandbox status in the about:gpu page. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Show about:sandbox status in the about:gpu page. Created 8 years, 3 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
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 5
6 /** 6 /**
7 * @fileoverview This view displays information on the current GPU 7 * @fileoverview This view displays information on the current GPU
8 * hardware. Its primary usefulness is to allow users to copy-paste 8 * hardware. Its primary usefulness is to allow users to copy-paste
9 * their data in an easy to read format for bug reports. 9 * their data in an easy to read format for bug reports.
10 */ 10 */
11 cr.define('gpu', function() { 11 cr.define('gpu', function() {
12 /** 12 /**
13 * Provides information on the GPU process and underlying graphics hardware. 13 * Provides information on the GPU process and underlying graphics hardware.
14 * @constructor 14 * @constructor
15 * @extends {cr.ui.TabPanel} 15 * @extends {cr.ui.TabPanel}
16 */ 16 */
17 var InfoView = cr.ui.define(cr.ui.TabPanel); 17 var InfoView = cr.ui.define(cr.ui.TabPanel);
18 18
19 InfoView.prototype = { 19 InfoView.prototype = {
20 __proto__: cr.ui.TabPanel.prototype, 20 __proto__: cr.ui.TabPanel.prototype,
21 21
22 decorate: function() { 22 decorate: function() {
23 cr.ui.TabPanel.prototype.decorate.apply(this); 23 cr.ui.TabPanel.prototype.decorate.apply(this);
24 24
25 browserBridge.addEventListener('gpuInfoUpdate', this.refresh.bind(this)); 25 browserBridge.addEventListener('gpuInfoUpdate', this.refresh.bind(this));
26 browserBridge.addEventListener('logMessagesChange', 26 browserBridge.addEventListener('logMessagesChange',
27 this.refresh.bind(this)); 27 this.refresh.bind(this));
28 browserBridge.addEventListener('clientInfoChange', 28 browserBridge.addEventListener('clientInfoChange',
29 this.refresh.bind(this)); 29 this.refresh.bind(this));
30 browserBridge.addEventListener('sandboxInfoChange',
31 this.refresh.bind(this));
30 browserBridge.addEventListener('crashListChange', 32 browserBridge.addEventListener('crashListChange',
31 this.refresh.bind(this)); 33 this.refresh.bind(this));
32 this.refresh(); 34 this.refresh();
33 }, 35 },
34 36
35 /** 37 /**
36 * Updates the view based on its currently known data 38 * Updates the view based on its currently known data
37 */ 39 */
38 refresh: function(data) { 40 refresh: function(data) {
39 // Client info 41 // Client info
(...skipping 25 matching lines...) Expand all
65 value: clientInfo.angle_revision 67 value: clientInfo.angle_revision
66 }, 68 },
67 { 69 {
68 description: '2D graphics backend', 70 description: '2D graphics backend',
69 value: clientInfo.graphics_backend 71 value: clientInfo.graphics_backend
70 }]); 72 }]);
71 } else { 73 } else {
72 this.setText_('client-info', '... loading...'); 74 this.setText_('client-info', '... loading...');
73 } 75 }
74 76
77 // Sandbox info
78 var sandboxStatusList = this.querySelector('.sandbox-status-list');
79 if (browserBridge.sandboxInfo) {
80 sandboxStatusList.textContent = '';
81 var sandboxInfo = browserBridge.sandboxInfo;
82 var statusList = [
83 {
84 description: 'SUID Sandbox',
85 value: sandboxInfo.suid_sanbox
86 },
87 {
88 description: 'PID namespaces',
89 value: sandboxInfo.pid_namespaces
90 },
91 {
92 description: 'Network namespaces',
93 value: sandboxInfo.net_namespaces
94 },
95 {
96 description: 'Seccomp-legacy sandbox',
97 value: sandboxInfo.seccomp_legacy
98 },
99 {
100 description: 'Seccomp-BPF sandbox',
101 value: sandboxInfo.seccomp_bpf
102 },
103 {
104 description: 'Adequately sandboxed',
105 value: sandboxInfo.sandbox_ok
106 }
107 ];
108 statusList.forEach(function(item) {
109 var featureEl = document.createElement('li');
110
111 var nameEl = document.createElement('span');
112 nameEl.textContent = item.description + ': ';
113 featureEl.appendChild(nameEl);
114
115 var statusEl = document.createElement('span');
116 if (item.value) {
117 statusEl.textContent = 'Yes';
118 statusEl.className = 'feature-green';
119 } else {
120 statusEl.textContent = 'No';
121 statusEl.className = 'feature-red';
122 }
123 featureEl.appendChild(statusEl);
124
125 sandboxStatusList.appendChild(featureEl);
126 });
127 } else {
128 sandboxStatusList.textContent = '';
129 }
130
75 // Feature map 131 // Feature map
76 var featureLabelMap = { 132 var featureLabelMap = {
77 '2d_canvas': 'Canvas', 133 '2d_canvas': 'Canvas',
78 '3d_css': '3D CSS', 134 '3d_css': '3D CSS',
79 'css_animation': 'CSS Animation', 135 'css_animation': 'CSS Animation',
80 'compositing': 'Compositing', 136 'compositing': 'Compositing',
81 'webgl': 'WebGL', 137 'webgl': 'WebGL',
82 'multisampling': 'WebGL multisampling', 138 'multisampling': 'WebGL multisampling',
83 'flash_3d': 'Flash 3D', 139 'flash_3d': 'Flash 3D',
84 'flash_stage3d': 'Flash Stage3D', 140 'flash_stage3d': 'Flash Stage3D',
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 341
286 peg.innerHTML = ''; 342 peg.innerHTML = '';
287 peg.appendChild(template); 343 peg.appendChild(template);
288 } 344 }
289 }; 345 };
290 346
291 return { 347 return {
292 InfoView: InfoView 348 InfoView: InfoView
293 }; 349 };
294 }); 350 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/gpu_internals/info_view.html ('k') | chrome/browser/ui/webui/gpu_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698