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

Side by Side Diff: Source/devtools/front_end/TimelinePanel.js

Issue 214443003: DevTools: Start/Stop timeline overview recording for available mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 * @return {!WebInspector.TimelineFrameModel} 225 * @return {!WebInspector.TimelineFrameModel}
226 */ 226 */
227 _frameModel: function() 227 _frameModel: function()
228 { 228 {
229 if (!this._lazyFrameModel) 229 if (!this._lazyFrameModel)
230 this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._mod el); 230 this._lazyFrameModel = new WebInspector.TimelineFrameModel(this._mod el);
231 return this._lazyFrameModel; 231 return this._lazyFrameModel;
232 }, 232 },
233 233
234 /** 234 /**
235 * @return {!WebInspector.TimelinePanel.Mode}
236 */
237 _availableModes: function()
238 {
239 if (this._modes)
240 return this._modes;
241
242 this._modes = {
243 Events: WebInspector.TimelinePanel.Mode.Events,
244 Frames: WebInspector.TimelinePanel.Mode.Frames,
245 Memory: WebInspector.TimelinePanel.Mode.Memory,
246 };
247
248 if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled())
249 this._modes.FlameChart = WebInspector.TimelinePanel.Mode.FlameChart;
250
251 if (Capabilities.canProfilePower)
252 this._modes.Power = WebInspector.TimelinePanel.Mode.Power;
253
254 return this._modes;
255 },
256
257 /**
235 * @return {!WebInspector.TimelineView} 258 * @return {!WebInspector.TimelineView}
236 */ 259 */
237 _timelineView: function() 260 _timelineView: function()
238 { 261 {
239 if (!this._lazyTimelineView) 262 if (!this._lazyTimelineView)
240 this._lazyTimelineView = new WebInspector.TimelineView(this, this._m odel); 263 this._lazyTimelineView = new WebInspector.TimelineView(this, this._m odel);
241 return this._lazyTimelineView; 264 return this._lazyTimelineView;
242 }, 265 },
243 266
244 /** 267 /**
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 { 310 {
288 this._viewsMap = {}; 311 this._viewsMap = {};
289 312
290 var topPaneSidebarElement = this._topPane.sidebarElement(); 313 var topPaneSidebarElement = this._topPane.sidebarElement();
291 topPaneSidebarElement.id = "timeline-overview-sidebar"; 314 topPaneSidebarElement.id = "timeline-overview-sidebar";
292 315
293 var overviewTreeElement = topPaneSidebarElement.createChild("ol", "sideb ar-tree vbox"); 316 var overviewTreeElement = topPaneSidebarElement.createChild("ol", "sideb ar-tree vbox");
294 var topPaneSidebarTree = new TreeOutline(overviewTreeElement); 317 var topPaneSidebarTree = new TreeOutline(overviewTreeElement);
295 318
296 this._overviewItems = {}; 319 this._overviewItems = {};
297 for (var mode in WebInspector.TimelinePanel.Mode) { 320 for (var mode in this._availableModes()) {
298 if (mode === WebInspector.TimelinePanel.Mode.FlameChart && !WebInspe ctor.experimentsSettings.timelineFlameChart.isEnabled() ||
299 mode === WebInspector.TimelinePanel.Mode.Power && !Capabilities. canProfilePower)
300 continue;
301 this._overviewItems[mode] = new WebInspector.SidebarTreeElement("tim eline-overview-sidebar-" + mode.toLowerCase(), WebInspector.UIString(mode)); 321 this._overviewItems[mode] = new WebInspector.SidebarTreeElement("tim eline-overview-sidebar-" + mode.toLowerCase(), WebInspector.UIString(mode));
302 var item = this._overviewItems[mode]; 322 var item = this._overviewItems[mode];
303 item.onselect = this._onModeChanged.bind(this, mode); 323 item.onselect = this._onModeChanged.bind(this, mode);
304 topPaneSidebarTree.appendChild(item); 324 topPaneSidebarTree.appendChild(item);
305 } 325 }
306 }, 326 },
307 327
308 _createStatusBarItems: function() 328 _createStatusBarItems: function()
309 { 329 {
310 var panelStatusBarElement = this.element.createChild("div", "panel-statu s-bar"); 330 var panelStatusBarElement = this.element.createChild("div", "panel-statu s-bar");
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 this._updateSelectionDetails(); 571 this._updateSelectionDetails();
552 }, 572 },
553 573
554 /** 574 /**
555 * @param {boolean} userInitiated 575 * @param {boolean} userInitiated
556 */ 576 */
557 _startRecording: function(userInitiated) 577 _startRecording: function(userInitiated)
558 { 578 {
559 this._userInitiatedRecording = userInitiated; 579 this._userInitiatedRecording = userInitiated;
560 this._model.startRecording(); 580 this._model.startRecording();
561 for (var mode in WebInspector.TimelinePanel.Mode) 581 for (var mode in this._availableModes())
562 this._viewsForMode(mode).overviewView.timelineStarted(); 582 this._viewsForMode(mode).overviewView.timelineStarted();
563 583
564 if (userInitiated) 584 if (userInitiated)
565 WebInspector.userMetrics.TimelineStarted.record(); 585 WebInspector.userMetrics.TimelineStarted.record();
566 }, 586 },
567 587
568 _stopRecording: function() 588 _stopRecording: function()
569 { 589 {
570 this._userInitiatedRecording = false; 590 this._userInitiatedRecording = false;
571 this._model.stopRecording(); 591 this._model.stopRecording();
572 for (var mode in WebInspector.TimelinePanel.Mode) 592 for (var mode in this._availableModes())
573 this._viewsForMode(mode).overviewView.timelineStopped(); 593 this._viewsForMode(mode).overviewView.timelineStopped();
574 }, 594 },
575 595
576 /** 596 /**
577 * @return {boolean} 597 * @return {boolean}
578 */ 598 */
579 _toggleTimelineButtonClicked: function() 599 _toggleTimelineButtonClicked: function()
580 { 600 {
581 if (this._operationInProgress) 601 if (this._operationInProgress)
582 return true; 602 return true;
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 * @param {!WebInspector.TimelineModel.Record} record 1167 * @param {!WebInspector.TimelineModel.Record} record
1148 * @return {boolean} 1168 * @return {boolean}
1149 */ 1169 */
1150 accept: function(record) 1170 accept: function(record)
1151 { 1171 {
1152 return !this._hiddenRecords[record.type]; 1172 return !this._hiddenRecords[record.type];
1153 }, 1173 },
1154 1174
1155 __proto__: WebInspector.TimelineModel.Filter.prototype 1175 __proto__: WebInspector.TimelineModel.Filter.prototype
1156 } 1176 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698