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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/PerformanceModel.js

Issue 2852173002: DevTools: Show screenshots on the main flamechart (Closed)
Patch Set: addressing comments Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 Timeline.PerformanceModel = class extends Common.Object { 5 Timeline.PerformanceModel = class extends Common.Object {
6 constructor() { 6 constructor() {
7 super(); 7 super();
8 /** @type {?SDK.Target} */ 8 /** @type {?SDK.Target} */
9 this._mainTarget = null; 9 this._mainTarget = null;
10 /** @type {?SDK.TracingModel} */ 10 /** @type {?SDK.TracingModel} */
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 extensionInfo() { 126 extensionInfo() {
127 return this._extensionTracingModels; 127 return this._extensionTracingModels;
128 } 128 }
129 129
130 dispose() { 130 dispose() {
131 if (this._tracingModel) 131 if (this._tracingModel)
132 this._tracingModel.reset(); 132 this._tracingModel.reset();
133 for (var extensionEntry of this._extensionTracingModels) 133 for (var extensionEntry of this._extensionTracingModels)
134 extensionEntry.model.reset(); 134 extensionEntry.model.reset();
135 } 135 }
136
137 /**
138 * @param {!TimelineModel.TimelineFrame} frame
139 * @return {?SDK.FilmStripModel.Frame}
140 */
141 filmStripModelFrame(frame) {
142 // For idle frames, look at the state at the beginning of the frame.
143 var screenshotTime = frame.idle ? frame.startTime : frame.endTime;
144 var filmStripFrame = this._filmStripModel.frameByTimestamp(screenshotTime);
145 return filmStripFrame && filmStripFrame.timestamp - frame.endTime < 10 ? fil mStripFrame : null;
146 }
136 }; 147 };
137 148
138 /** 149 /**
139 * @enum {symbol} 150 * @enum {symbol}
140 */ 151 */
141 Timeline.PerformanceModel.Events = { 152 Timeline.PerformanceModel.Events = {
142 ExtensionDataAdded: Symbol('ExtensionDataAdded') 153 ExtensionDataAdded: Symbol('ExtensionDataAdded')
143 }; 154 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698