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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/layer_viewer/Layers3DView.js

Issue 2770523002: DevTools: kill Common.Throttler.flush() method (Closed)
Patch Set: Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 layerNeedsUpdate(layer) { 973 layerNeedsUpdate(layer) {
974 if (this._queue.indexOf(layer) < 0) 974 if (this._queue.indexOf(layer) < 0)
975 this._queue.push(layer); 975 this._queue.push(layer);
976 if (this._active) 976 if (this._active)
977 this._throttler.schedule(this._update.bind(this)); 977 this._throttler.schedule(this._update.bind(this));
978 } 978 }
979 979
980 forceUpdate() { 980 forceUpdate() {
981 this._queue.forEach(layer => this._updateLayer(layer)); 981 this._queue.forEach(layer => this._updateLayer(layer));
982 this._queue = []; 982 this._queue = [];
983 this._throttler.flush(); 983 this._update();
984 } 984 }
985 985
986 /** 986 /**
987 * @return {!Promise} 987 * @return {!Promise}
988 */ 988 */
989 _update() { 989 _update() {
990 var layer = this._queue.shift(); 990 var layer = this._queue.shift();
991 if (!layer) 991 if (!layer)
992 return Promise.resolve(); 992 return Promise.resolve();
993 if (this._queue.length) 993 if (this._queue.length)
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 * @return {!Promise} 1175 * @return {!Promise}
1176 */ 1176 */
1177 update(glContext, scale) { 1177 update(glContext, scale) {
1178 this._gl = glContext; 1178 this._gl = glContext;
1179 this.scale = scale; 1179 this.scale = scale;
1180 return this.snapshot.replay(null, null, scale).then(imageURL => imageURL && UI.loadImage(imageURL)).then(image => { 1180 return this.snapshot.replay(null, null, scale).then(imageURL => imageURL && UI.loadImage(imageURL)).then(image => {
1181 this.texture = image && LayerViewer.LayerTextureManager._createTextureForI mage(glContext, image); 1181 this.texture = image && LayerViewer.LayerTextureManager._createTextureForI mage(glContext, image);
1182 }); 1182 });
1183 } 1183 }
1184 }; 1184 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698