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

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

Issue 481403002: DevTools: move tracing based Timeline out of experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated inspector/timeline/timeline-coalescing.html Created 6 years, 4 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
« no previous file with comments | « Source/devtools/front_end/sdk/Target.js ('k') | 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 29 matching lines...) Expand all
40 WebInspector.Panel.call(this, "timeline"); 40 WebInspector.Panel.call(this, "timeline");
41 this.registerRequiredCSS("timelinePanel.css"); 41 this.registerRequiredCSS("timelinePanel.css");
42 this.registerRequiredCSS("layersPanel.css"); 42 this.registerRequiredCSS("layersPanel.css");
43 this.registerRequiredCSS("filter.css"); 43 this.registerRequiredCSS("filter.css");
44 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f alse); 44 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f alse);
45 45
46 this._detailsLinkifier = new WebInspector.Linkifier(); 46 this._detailsLinkifier = new WebInspector.Linkifier();
47 this._windowStartTime = 0; 47 this._windowStartTime = 0;
48 this._windowEndTime = Infinity; 48 this._windowEndTime = Infinity;
49 49
50 // Create model. 50 this._tracingModel = new WebInspector.TracingModel();
51 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) { 51 this._tracingModel.addEventListener(WebInspector.TracingModel.Events.BufferU sage, this._onTracingBufferUsage, this);
52 this._tracingModel = new WebInspector.TracingModel();
53 this._tracingModel.addEventListener(WebInspector.TracingModel.Events.Buf ferUsage, this._onTracingBufferUsage, this);
54 52
55 this._uiUtils = new WebInspector.TracingTimelineUIUtils(); 53 this._uiUtils = new WebInspector.TracingTimelineUIUtils();
56 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this. _tracingModel, this._uiUtils.hiddenRecordsFilter()); 54 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(this._tra cingModel, this._uiUtils.hiddenRecordsFilter());
57 this._model = this._tracingTimelineModel; 55 this._model = this._tracingTimelineModel;
58 } else {
59 this._uiUtils = new WebInspector.TimelineUIUtilsImpl();
60 this._model = new WebInspector.TimelineModelImpl();
61 }
62 56
63 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar ted, this._onRecordingStarted, this); 57 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStar ted, this._onRecordingStarted, this);
64 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop ped, this._onRecordingStopped, this); 58 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStop ped, this._onRecordingStopped, this);
65 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare d, this._onRecordsCleared, this); 59 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleare d, this._onRecordsCleared, this);
66 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg ress, this._onRecordingProgress, this); 60 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingProg ress, this._onRecordingProgress, this);
67 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC hanged, this._refreshViews, this); 61 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordFilterC hanged, this._refreshViews, this);
68 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this); 62 this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this);
69 63
70 this._categoryFilter = new WebInspector.TimelineCategoryFilter(this._uiUtils ); 64 this._categoryFilter = new WebInspector.TimelineCategoryFilter(this._uiUtils );
71 this._durationFilter = new WebInspector.TimelineIsLongFilter(); 65 this._durationFilter = new WebInspector.TimelineIsLongFilter();
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 garbageCollectButton.addEventListener("click", this._garbageCollectButto nClicked, this); 325 garbageCollectButton.addEventListener("click", this._garbageCollectButto nClicked, this);
332 this._statusBarButtons.push(garbageCollectButton); 326 this._statusBarButtons.push(garbageCollectButton);
333 panelStatusBarElement.appendChild(garbageCollectButton.element); 327 panelStatusBarElement.appendChild(garbageCollectButton.element);
334 328
335 var framesToggleButton = new WebInspector.StatusBarButton(WebInspector.U IString("Frames mode"), "timeline-frames-status-bar-item"); 329 var framesToggleButton = new WebInspector.StatusBarButton(WebInspector.U IString("Frames mode"), "timeline-frames-status-bar-item");
336 framesToggleButton.toggled = this._overviewModeSetting.get() === WebInsp ector.TimelinePanel.OverviewMode.Frames; 330 framesToggleButton.toggled = this._overviewModeSetting.get() === WebInsp ector.TimelinePanel.OverviewMode.Frames;
337 framesToggleButton.addEventListener("click", this._overviewModeChanged.b ind(this, framesToggleButton)); 331 framesToggleButton.addEventListener("click", this._overviewModeChanged.b ind(this, framesToggleButton));
338 this._statusBarButtons.push(framesToggleButton); 332 this._statusBarButtons.push(framesToggleButton);
339 panelStatusBarElement.appendChild(framesToggleButton.element); 333 panelStatusBarElement.appendChild(framesToggleButton.element);
340 334
341 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) { 335 var flameChartToggleButton = new WebInspector.StatusBarButton(WebInspect or.UIString("Tracing mode"), "timeline-flame-chart-status-bar-item");
342 var flameChartToggleButton = new WebInspector.StatusBarButton(WebIns pector.UIString("Tracing mode"), "timeline-flame-chart-status-bar-item"); 336 flameChartToggleButton.toggled = this._flameChartEnabledSetting.get();
343 flameChartToggleButton.toggled = this._flameChartEnabledSetting.get( ); 337 flameChartToggleButton.addEventListener("click", this._flameChartEnabled Changed.bind(this, flameChartToggleButton));
344 flameChartToggleButton.addEventListener("click", this._flameChartEna bledChanged.bind(this, flameChartToggleButton)); 338 this._statusBarButtons.push(flameChartToggleButton);
345 this._statusBarButtons.push(flameChartToggleButton); 339 panelStatusBarElement.appendChild(flameChartToggleButton.element);
346 panelStatusBarElement.appendChild(flameChartToggleButton.element);
347 }
348 340
349 this._captureStacksSetting = WebInspector.settings.createSetting("timeli neCaptureStacks", true); 341 this._captureStacksSetting = WebInspector.settings.createSetting("timeli neCaptureStacks", true);
350 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect or.UIString("Stacks"), 342 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect or.UIString("Stacks"),
351 this._capt ureStacksSetting, 343 this._capt ureStacksSetting,
352 WebInspect or.UIString("Capture JavaScript stack on every timeline event"))); 344 WebInspect or.UIString("Capture JavaScript stack on every timeline event")));
353 this._captureMemorySetting = WebInspector.settings.createSetting("timeli neCaptureMemory", false); 345 this._captureMemorySetting = WebInspector.settings.createSetting("timeli neCaptureMemory", false);
354 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect or.UIString("Memory"), 346 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebInspect or.UIString("Memory"),
355 this._capt ureMemorySetting, 347 this._capt ureMemorySetting,
356 WebInspect or.UIString("Capture memory information on every timeline event"))); 348 WebInspect or.UIString("Capture memory information on every timeline event")));
357 this._captureMemorySetting.addChangeListener(this._onModeChanged, this); 349 this._captureMemorySetting.addChangeListener(this._onModeChanged, this);
358 if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled() & & 350 if (WebInspector.experimentsSettings.timelinePowerProfiler.isEnabled() & &
359 WebInspector.targetManager.mainTarget().hasCapability(WebInspector.T arget.Capabilities.CanProfilePower)) { 351 WebInspector.targetManager.mainTarget().hasCapability(WebInspector.T arget.Capabilities.CanProfilePower)) {
360 this._capturePowerSetting = WebInspector.settings.createSetting("tim elineCapturePower", false); 352 this._capturePowerSetting = WebInspector.settings.createSetting("tim elineCapturePower", false);
361 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns pector.UIString("Power"), 353 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns pector.UIString("Power"),
362 this._ capturePowerSetting, 354 this._ capturePowerSetting,
363 WebIns pector.UIString("Capture power information"))); 355 WebIns pector.UIString("Capture power information")));
364 this._capturePowerSetting.addChangeListener(this._onModeChanged, thi s); 356 this._capturePowerSetting.addChangeListener(this._onModeChanged, thi s);
365 } 357 }
366 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled() & & 358 if (WebInspector.experimentsSettings.paintProfiler.isEnabled()) {
367 WebInspector.experimentsSettings.paintProfiler.isEnabled()) {
368 this._captureLayersAndPicturesSetting = WebInspector.settings.create Setting("timelineCaptureLayersAndPictures", false); 359 this._captureLayersAndPicturesSetting = WebInspector.settings.create Setting("timelineCaptureLayersAndPictures", false);
369 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns pector.UIString("Paint"), 360 panelStatusBarElement.appendChild(this._createSettingCheckbox(WebIns pector.UIString("Paint"),
370 this._ captureLayersAndPicturesSetting, 361 this._ captureLayersAndPicturesSetting,
371 WebIns pector.UIString("Capture graphics layer positions and painted pictures"))); 362 WebIns pector.UIString("Capture graphics layer positions and painted pictures")));
372 } 363 }
373 364
374 this._miscStatusBarItems = panelStatusBarElement.createChild("div", "sta tus-bar-item"); 365 this._miscStatusBarItems = panelStatusBarElement.createChild("div", "sta tus-bar-item");
375 366
376 this._filtersContainer = this.element.createChild("div", "timeline-filte rs-header hidden"); 367 this._filtersContainer = this.element.createChild("div", "timeline-filte rs-header hidden");
377 this._filtersContainer.appendChild(this._filterBar.filtersElement()); 368 this._filtersContainer.appendChild(this._filterBar.filtersElement());
378 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersTo ggled, this._onFiltersToggled, this); 369 this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersTo ggled, this._onFiltersToggled, this);
379 this._filterBar.setName("timelinePanel"); 370 this._filterBar.setName("timelinePanel");
380 if (!WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled()) {
381 var targetsComboBox = new WebInspector.StatusBarComboBox(null);
382 panelStatusBarElement.appendChild(targetsComboBox.element);
383 new WebInspector.TargetsComboBoxController(targetsComboBox.selectEle ment(), targetsComboBox.element);
384 }
385 }, 371 },
386 372
387 /** 373 /**
388 * @return {!WebInspector.FilterBar} 374 * @return {!WebInspector.FilterBar}
389 */ 375 */
390 _createFilterBar: function() 376 _createFilterBar: function()
391 { 377 {
392 this._filterBar = new WebInspector.FilterBar(); 378 this._filterBar = new WebInspector.FilterBar();
393 this._filters = {}; 379 this._filters = {};
394 this._filters._textFilterUI = new WebInspector.TextFilterUI(); 380 this._filters._textFilterUI = new WebInspector.TextFilterUI();
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 * @param {!WebInspector.TimelineModel.Record} record 1396 * @param {!WebInspector.TimelineModel.Record} record
1411 * @return {boolean} 1397 * @return {boolean}
1412 */ 1398 */
1413 accept: function(record) 1399 accept: function(record)
1414 { 1400 {
1415 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex); 1401 return !this._regex || this._uiUtils.testContentMatching(record, this._r egex);
1416 }, 1402 },
1417 1403
1418 __proto__: WebInspector.TimelineModel.Filter.prototype 1404 __proto__: WebInspector.TimelineModel.Filter.prototype
1419 } 1405 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/Target.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698