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

Side by Side Diff: Source/devtools/front_end/timeline/TimelinePaintProfilerView.js

Issue 1163223003: DevTools: better error handling in paint profiler UI (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * @constructor 6 * @constructor
7 * @param {!WebInspector.TracingTimelineFrameModel} frameModel 7 * @param {!WebInspector.TracingTimelineFrameModel} frameModel
8 * @extends {WebInspector.SplitWidget} 8 * @extends {WebInspector.SplitWidget}
9 */ 9 */
10 WebInspector.TimelinePaintProfilerView = function(frameModel) 10 WebInspector.TimelinePaintProfilerView = function(frameModel)
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 /** 85 /**
86 * @param {?DOMAgent.Rect} tileRect 86 * @param {?DOMAgent.Rect} tileRect
87 * @param {?WebInspector.PaintProfilerSnapshot} snapshot 87 * @param {?WebInspector.PaintProfilerSnapshot} snapshot
88 * @this WebInspector.TimelinePaintProfilerView 88 * @this WebInspector.TimelinePaintProfilerView
89 */ 89 */
90 function onSnapshotLoaded(tileRect, snapshot) 90 function onSnapshotLoaded(tileRect, snapshot)
91 { 91 {
92 this._disposeSnapshot(); 92 this._disposeSnapshot();
93 this._lastLoadedSnapshot = snapshot; 93 this._lastLoadedSnapshot = snapshot;
94 this._imageView.setMask(tileRect); 94 this._imageView.setMask(tileRect);
95 if (!snapshot) 95 if (!snapshot) {
96 this._imageView.showImage();
96 return; 97 return;
98 }
97 snapshot.commandLog(onCommandLogDone.bind(this, snapshot, tileRect)) ; 99 snapshot.commandLog(onCommandLogDone.bind(this, snapshot, tileRect)) ;
98 } 100 }
99 101
100 /** 102 /**
101 * @param {!WebInspector.PaintProfilerSnapshot} snapshot 103 * @param {!WebInspector.PaintProfilerSnapshot} snapshot
102 * @param {?DOMAgent.Rect} clipRect 104 * @param {?DOMAgent.Rect} clipRect
103 * @param {!Array.<!WebInspector.PaintProfilerLogItem>=} log 105 * @param {!Array.<!WebInspector.PaintProfilerLogItem>=} log
104 * @this {WebInspector.TimelinePaintProfilerView} 106 * @this {WebInspector.TimelinePaintProfilerView}
105 */ 107 */
106 function onCommandLogDone(snapshot, clipRect, log) 108 function onCommandLogDone(snapshot, clipRect, log)
107 { 109 {
108 this._logTreeView.setCommandLog(snapshot.target(), log); 110 this._logTreeView.setCommandLog(snapshot.target(), log || []);
109 this._paintProfilerView.setSnapshotAndLog(snapshot, log || [], clipR ect); 111 this._paintProfilerView.setSnapshotAndLog(snapshot, log || [], clipR ect);
110 } 112 }
111 }, 113 },
112 114
113 _disposeSnapshot: function() 115 _disposeSnapshot: function()
114 { 116 {
115 if (!this._lastLoadedSnapshot) 117 if (!this._lastLoadedSnapshot)
116 return; 118 return;
117 this._lastLoadedSnapshot.dispose(); 119 this._lastLoadedSnapshot.dispose();
118 this._lastLoadedSnapshot = null; 120 this._lastLoadedSnapshot = null;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 matrix = new WebKitCSSMatrix().translate(this._transformController.offse tX(), this._transformController.offsetY()).multiply(matrix); 188 matrix = new WebKitCSSMatrix().translate(this._transformController.offse tX(), this._transformController.offsetY()).multiply(matrix);
187 this._imageContainer.style.webkitTransform = matrix.toString(); 189 this._imageContainer.style.webkitTransform = matrix.toString();
188 }, 190 },
189 191
190 /** 192 /**
191 * @param {string=} imageURL 193 * @param {string=} imageURL
192 */ 194 */
193 showImage: function(imageURL) 195 showImage: function(imageURL)
194 { 196 {
195 this._imageContainer.classList.toggle("hidden", !imageURL); 197 this._imageContainer.classList.toggle("hidden", !imageURL);
196 this._imageElement.src = imageURL; 198 if (imageURL)
199 this._imageElement.src = imageURL;
197 }, 200 },
198 201
199 /** 202 /**
200 * @param {?DOMAgent.Rect} maskRectangle 203 * @param {?DOMAgent.Rect} maskRectangle
201 */ 204 */
202 setMask: function(maskRectangle) 205 setMask: function(maskRectangle)
203 { 206 {
204 this._maskRectangle = maskRectangle; 207 this._maskRectangle = maskRectangle;
205 this._maskElement.classList.toggle("hidden", !maskRectangle); 208 this._maskElement.classList.toggle("hidden", !maskRectangle);
206 }, 209 },
207 210
208 __proto__: WebInspector.Widget.prototype 211 __proto__: WebInspector.Widget.prototype
209 }; 212 };
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/PaintProfilerView.js ('k') | Source/devtools/front_end/ui_lazy/OverviewGrid.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698