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

Side by Side Diff: content/browser/resources/gpu/browser_bridge.js

Issue 1637423004: Show Compositor information in chrome://gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: has -> have Created 4 years, 10 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 | « content/browser/gpu/gpu_internals_ui.cc ('k') | content/browser/resources/gpu/info_view.html » ('j') | 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 cr.define('gpu', function() { 4 cr.define('gpu', function() {
5 /** 5 /**
6 * This class provides a 'bridge' for communicating between javascript and the 6 * This class provides a 'bridge' for communicating between javascript and the
7 * browser. When run outside of WebUI, e.g. as a regular webpage, it provides 7 * browser. When run outside of WebUI, e.g. as a regular webpage, it provides
8 * synthetic data to assist in testing. 8 * synthetic data to assist in testing.
9 * @constructor 9 * @constructor
10 */ 10 */
(...skipping 18 matching lines...) Expand all
29 this.beginRequestLogMessages_(); 29 this.beginRequestLogMessages_();
30 } 30 }
31 } 31 }
32 32
33 BrowserBridge.prototype = { 33 BrowserBridge.prototype = {
34 __proto__: cr.EventTarget.prototype, 34 __proto__: cr.EventTarget.prototype,
35 35
36 applySimulatedData_: function applySimulatedData(data) { 36 applySimulatedData_: function applySimulatedData(data) {
37 // set up things according to the simulated data 37 // set up things according to the simulated data
38 this.gpuInfo_ = data.gpuInfo; 38 this.gpuInfo_ = data.gpuInfo;
39 this.gpuMemoryBufferInfo_ = data.gpuMemoryBufferInfo;
40 this.clientInfo_ = data.clientInfo; 39 this.clientInfo_ = data.clientInfo;
41 this.logMessages_ = data.logMessages; 40 this.logMessages_ = data.logMessages;
42 cr.dispatchSimpleEvent(this, 'gpuInfoUpdate'); 41 cr.dispatchSimpleEvent(this, 'gpuInfoUpdate');
43 cr.dispatchSimpleEvent(this, 'gpuMemoryBufferInfoUpdate');
44 cr.dispatchSimpleEvent(this, 'clientInfoChange'); 42 cr.dispatchSimpleEvent(this, 'clientInfoChange');
45 cr.dispatchSimpleEvent(this, 'logMessagesChange'); 43 cr.dispatchSimpleEvent(this, 'logMessagesChange');
46 }, 44 },
47 45
48 /** 46 /**
49 * Returns true if the page is hosted inside Chrome WebUI 47 * Returns true if the page is hosted inside Chrome WebUI
50 * Helps have behavior conditional to emulate_webui.py 48 * Helps have behavior conditional to emulate_webui.py
51 */ 49 */
52 get debugMode() { 50 get debugMode() {
53 return this.debugMode_; 51 return this.debugMode_;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 88
91 /** 89 /**
92 * Called from gpu c++ code when GPU Info is updated. 90 * Called from gpu c++ code when GPU Info is updated.
93 */ 91 */
94 onGpuInfoUpdate: function(gpuInfo) { 92 onGpuInfoUpdate: function(gpuInfo) {
95 this.gpuInfo_ = gpuInfo; 93 this.gpuInfo_ = gpuInfo;
96 cr.dispatchSimpleEvent(this, 'gpuInfoUpdate'); 94 cr.dispatchSimpleEvent(this, 'gpuInfoUpdate');
97 }, 95 },
98 96
99 /** 97 /**
100 * Get gpuMemoryBufferInfo data.
101 */
102 get gpuMemoryBufferInfo() {
103 return this.gpuMemoryBufferInfo_;
104 },
105
106 /**
107 * Called from gpu c++ code when GpuMemoryBuffer Info is updated.
108 */
109 onGpuMemoryBufferInfoUpdate: function(gpuMemoryBufferInfo) {
110 this.gpuMemoryBufferInfo_ = gpuMemoryBufferInfo;
111 cr.dispatchSimpleEvent(this, 'gpuMemoryBufferInfoUpdate');
112 },
113
114 /**
115 * This function begins a request for the ClientInfo. If it comes back 98 * This function begins a request for the ClientInfo. If it comes back
116 * as undefined, then we will issue the request again in 250ms. 99 * as undefined, then we will issue the request again in 250ms.
117 */ 100 */
118 beginRequestClientInfo_: function() { 101 beginRequestClientInfo_: function() {
119 this.callAsync('requestClientInfo', undefined, (function(data) { 102 this.callAsync('requestClientInfo', undefined, (function(data) {
120 if (data === undefined) { // try again in 250 ms 103 if (data === undefined) { // try again in 250 ms
121 window.setTimeout(this.beginRequestClientInfo_.bind(this), 250); 104 window.setTimeout(this.beginRequestClientInfo_.bind(this), 250);
122 } else { 105 } else {
123 this.clientInfo_ = data; 106 this.clientInfo_ = data;
124 cr.dispatchSimpleEvent(this, 'clientInfoChange'); 107 cr.dispatchSimpleEvent(this, 'clientInfoChange');
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return info.value; 149 return info.value;
167 } 150 }
168 return false; 151 return false;
169 } 152 }
170 }; 153 };
171 154
172 return { 155 return {
173 BrowserBridge: BrowserBridge 156 BrowserBridge: BrowserBridge
174 }; 157 };
175 }); 158 });
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_internals_ui.cc ('k') | content/browser/resources/gpu/info_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698