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

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

Issue 2218603003: Timeline: show white overlay till page being reloaded paints (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 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
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 * @param {!WebInspector.ToolbarButton} toolbarButton 571 * @param {!WebInspector.ToolbarButton} toolbarButton
572 */ 572 */
573 function handler(toolbarButton) 573 function handler(toolbarButton)
574 { 574 {
575 toolbarButton.setEnabled(enabled); 575 toolbarButton.setEnabled(enabled);
576 } 576 }
577 this._recordingOptionUIControls.forEach(handler); 577 this._recordingOptionUIControls.forEach(handler);
578 }, 578 },
579 579
580 /** 580 /**
581 * @param {boolean} userInitiated 581 * @param {boolean} autorecordUponReload
582 */ 582 */
583 _startRecording: function(userInitiated) 583 _startRecording: function(autorecordUponReload)
584 { 584 {
585 console.assert(!this._statusPane, "Status pane is already opened."); 585 console.assert(!this._statusPane, "Status pane is already opened.");
586 var mainTarget = WebInspector.targetManager.mainTarget(); 586 var mainTarget = WebInspector.targetManager.mainTarget();
587 if (!mainTarget) 587 if (!mainTarget)
588 return; 588 return;
589 this._setState(WebInspector.TimelinePanel.State.StartPending); 589 this._setState(WebInspector.TimelinePanel.State.StartPending);
590 this._showRecordingStarted(); 590 this._showRecordingStarted();
591 591
592 this._autoRecordGeneration = userInitiated ? null : Symbol("Generation") ; 592 this._autoRecordGeneration = autorecordUponReload ? Symbol("Generation") : null;
593 this._controller = new WebInspector.TimelineController(mainTarget, this, this._tracingModel); 593 this._controller = new WebInspector.TimelineController(mainTarget, this, this._tracingModel);
594 this._controller.startRecording(true, this._captureJSProfileSetting.get( ), this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting.get() , this._captureFilmStripSetting && this._captureFilmStripSetting.get()); 594 this._controller.startRecording(true, this._captureJSProfileSetting.get( ), this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting.get() , this._captureFilmStripSetting && this._captureFilmStripSetting.get(), autoreco rdUponReload ? WebInspector.UIString("Reloading…") : undefined);
595 595
596 for (var i = 0; i < this._overviewControls.length; ++i) 596 for (var i = 0; i < this._overviewControls.length; ++i)
597 this._overviewControls[i].timelineStarted(); 597 this._overviewControls[i].timelineStarted();
598 598
599 if (userInitiated) 599 if (!autorecordUponReload)
600 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action .TimelineStarted); 600 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action .TimelineStarted);
601 this._setUIControlsEnabled(false); 601 this._setUIControlsEnabled(false);
602 this._hideRecordingHelpMessage(); 602 this._hideRecordingHelpMessage();
603 }, 603 },
604 604
605 _stopRecording: function() 605 _stopRecording: function()
606 { 606 {
607 if (this._statusPane) { 607 if (this._statusPane) {
608 this._statusPane.finish(); 608 this._statusPane.finish();
609 this._statusPane.updateStatus(WebInspector.UIString("Stopping timeli ne\u2026")); 609 this._statusPane.updateStatus(WebInspector.UIString("Stopping timeli ne\u2026"));
(...skipping 16 matching lines...) Expand all
626 var state = WebInspector.TimelinePanel.State; 626 var state = WebInspector.TimelinePanel.State;
627 this._toggleRecordAction.setToggled(this._state === state.Recording); 627 this._toggleRecordAction.setToggled(this._state === state.Recording);
628 this._toggleRecordAction.setEnabled(this._state === state.Recording || t his._state === state.Idle); 628 this._toggleRecordAction.setEnabled(this._state === state.Recording || t his._state === state.Idle);
629 this._panelToolbar.setEnabled(this._state !== state.Loading); 629 this._panelToolbar.setEnabled(this._state !== state.Loading);
630 this._dropTarget.setEnabled(this._state === state.Idle); 630 this._dropTarget.setEnabled(this._state === state.Idle);
631 }, 631 },
632 632
633 _toggleRecording: function() 633 _toggleRecording: function()
634 { 634 {
635 if (this._state === WebInspector.TimelinePanel.State.Idle) 635 if (this._state === WebInspector.TimelinePanel.State.Idle)
636 this._startRecording(true); 636 this._startRecording(false);
637 else if (this._state === WebInspector.TimelinePanel.State.Recording) 637 else if (this._state === WebInspector.TimelinePanel.State.Recording)
638 this._stopRecording(); 638 this._stopRecording();
639 }, 639 },
640 640
641 _garbageCollectButtonClicked: function() 641 _garbageCollectButtonClicked: function()
642 { 642 {
643 var targets = WebInspector.targetManager.targets(); 643 var targets = WebInspector.targetManager.targets();
644 for (var i = 0; i < targets.length; ++i) 644 for (var i = 0; i < targets.length; ++i)
645 targets[i].heapProfilerAgent().collectGarbage(); 645 targets[i].heapProfilerAgent().collectGarbage();
646 }, 646 },
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 this._overviewPane.setMarkers(markers); 823 this._overviewPane.setMarkers(markers);
824 }, 824 },
825 825
826 /** 826 /**
827 * @param {!WebInspector.Event} event 827 * @param {!WebInspector.Event} event
828 */ 828 */
829 _pageReloadRequested: function(event) 829 _pageReloadRequested: function(event)
830 { 830 {
831 if (this._state !== WebInspector.TimelinePanel.State.Idle || !this.isSho wing()) 831 if (this._state !== WebInspector.TimelinePanel.State.Idle || !this.isSho wing())
832 return; 832 return;
833 this._startRecording(false); 833 this._startRecording(true);
834 }, 834 },
835 835
836 /** 836 /**
837 * @param {!WebInspector.Event} event 837 * @param {!WebInspector.Event} event
838 */ 838 */
839 _loadEventFired: function(event) 839 _loadEventFired: function(event)
840 { 840 {
841 if (this._state !== WebInspector.TimelinePanel.State.Recording || !this. _autoRecordGeneration) 841 if (this._state !== WebInspector.TimelinePanel.State.Recording || !this. _autoRecordGeneration)
842 return; 842 return;
843 setTimeout(stopRecordingOnReload.bind(this, this._autoRecordGeneration), this._millisecondsToRecordAfterLoadEvent); 843 setTimeout(stopRecordingOnReload.bind(this, this._autoRecordGeneration), this._millisecondsToRecordAfterLoadEvent);
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 * @override 2016 * @override
2017 * @param {!WebInspector.Target} target 2017 * @param {!WebInspector.Target} target
2018 */ 2018 */
2019 targetRemoved: function(target) 2019 targetRemoved: function(target)
2020 { 2020 {
2021 this._targets.remove(target, true); 2021 this._targets.remove(target, true);
2022 }, 2022 },
2023 2023
2024 __proto__: WebInspector.Object.prototype 2024 __proto__: WebInspector.Object.prototype
2025 } 2025 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698