| 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 | 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)); | |
| 32 browserBridge.addEventListener('crashListChange', | 30 browserBridge.addEventListener('crashListChange', |
| 33 this.refresh.bind(this)); | 31 this.refresh.bind(this)); |
| 34 this.refresh(); | 32 this.refresh(); |
| 35 }, | 33 }, |
| 36 | 34 |
| 37 /** | 35 /** |
| 38 * Updates the view based on its currently known data | 36 * Updates the view based on its currently known data |
| 39 */ | 37 */ |
| 40 refresh: function(data) { | 38 refresh: function(data) { |
| 41 // Client info | 39 // Client info |
| (...skipping 25 matching lines...) Expand all Loading... |
| 67 value: clientInfo.angle_revision | 65 value: clientInfo.angle_revision |
| 68 }, | 66 }, |
| 69 { | 67 { |
| 70 description: '2D graphics backend', | 68 description: '2D graphics backend', |
| 71 value: clientInfo.graphics_backend | 69 value: clientInfo.graphics_backend |
| 72 }]); | 70 }]); |
| 73 } else { | 71 } else { |
| 74 this.setText_('client-info', '... loading...'); | 72 this.setText_('client-info', '... loading...'); |
| 75 } | 73 } |
| 76 | 74 |
| 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 | |
| 131 // Feature map | 75 // Feature map |
| 132 var featureLabelMap = { | 76 var featureLabelMap = { |
| 133 '2d_canvas': 'Canvas', | 77 '2d_canvas': 'Canvas', |
| 134 '3d_css': '3D CSS', | 78 '3d_css': '3D CSS', |
| 135 'css_animation': 'CSS Animation', | 79 'css_animation': 'CSS Animation', |
| 136 'compositing': 'Compositing', | 80 'compositing': 'Compositing', |
| 137 'webgl': 'WebGL', | 81 'webgl': 'WebGL', |
| 138 'multisampling': 'WebGL multisampling', | 82 'multisampling': 'WebGL multisampling', |
| 139 'flash_3d': 'Flash 3D', | 83 'flash_3d': 'Flash 3D', |
| 140 'flash_stage3d': 'Flash Stage3D', | 84 'flash_stage3d': 'Flash Stage3D', |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 285 |
| 342 peg.innerHTML = ''; | 286 peg.innerHTML = ''; |
| 343 peg.appendChild(template); | 287 peg.appendChild(template); |
| 344 } | 288 } |
| 345 }; | 289 }; |
| 346 | 290 |
| 347 return { | 291 return { |
| 348 InfoView: InfoView | 292 InfoView: InfoView |
| 349 }; | 293 }; |
| 350 }); | 294 }); |
| OLD | NEW |