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

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

Issue 1807093002: DevTools: Resume targets *after* stopping timeline recording. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing caseq comment. Created 4 years, 9 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 | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 this._toggleRecordAction = WebInspector.actionRegistry.action("timeline.togg le-recording"); 51 this._toggleRecordAction = WebInspector.actionRegistry.action("timeline.togg le-recording");
52 52
53 // Create models. 53 // Create models.
54 this._tracingModelBackingStorage = new WebInspector.TempFileBackingStorage(" tracing"); 54 this._tracingModelBackingStorage = new WebInspector.TempFileBackingStorage(" tracing");
55 this._tracingModel = new WebInspector.TracingModel(this._tracingModelBacking Storage); 55 this._tracingModel = new WebInspector.TracingModel(this._tracingModelBacking Storage);
56 this._model = new WebInspector.TimelineModel(WebInspector.TimelineUIUtils.vi sibleEventsFilter()); 56 this._model = new WebInspector.TimelineModel(WebInspector.TimelineUIUtils.vi sibleEventsFilter());
57 this._frameModel = new WebInspector.TracingTimelineFrameModel(); 57 this._frameModel = new WebInspector.TracingTimelineFrameModel();
58 if (Runtime.experiments.isEnabled("timelineLatencyInfo")) 58 if (Runtime.experiments.isEnabled("timelineLatencyInfo"))
59 this._irModel = new WebInspector.TimelineIRModel(); 59 this._irModel = new WebInspector.TimelineIRModel();
60 60
61 this._controller = new WebInspector.TimelineController(this, this._tracingMo del);
62
63 if (Runtime.experiments.isEnabled("cpuThrottling")) 61 if (Runtime.experiments.isEnabled("cpuThrottling"))
64 this._cpuThrottlingManager = new WebInspector.CPUThrottlingManager(); 62 this._cpuThrottlingManager = new WebInspector.CPUThrottlingManager();
65 63
66 /** @type {!Array.<!WebInspector.TimelineModeView>} */ 64 /** @type {!Array.<!WebInspector.TimelineModeView>} */
67 this._currentViews = []; 65 this._currentViews = [];
68 66
69 this._viewModeSetting = WebInspector.settings.createSetting("timelineViewMod e", WebInspector.TimelinePanel.ViewMode.FlameChart); 67 this._viewModeSetting = WebInspector.settings.createSetting("timelineViewMod e", WebInspector.TimelinePanel.ViewMode.FlameChart);
70 this._captureNetworkSetting = WebInspector.settings.createSetting("timelineC aptureNetwork", false); 68 this._captureNetworkSetting = WebInspector.settings.createSetting("timelineC aptureNetwork", false);
71 this._captureJSProfileSetting = WebInspector.settings.createSetting("timelin eEnableJSSampling", true); 69 this._captureJSProfileSetting = WebInspector.settings.createSetting("timelin eEnableJSSampling", true);
72 this._captureMemorySetting = WebInspector.settings.createSetting("timelineCa ptureMemory", false); 70 this._captureMemorySetting = WebInspector.settings.createSetting("timelineCa ptureMemory", false);
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 } 605 }
608 this._recordingOptionUIControls.forEach(handler); 606 this._recordingOptionUIControls.forEach(handler);
609 }, 607 },
610 608
611 /** 609 /**
612 * @param {boolean} userInitiated 610 * @param {boolean} userInitiated
613 */ 611 */
614 _startRecording: function(userInitiated) 612 _startRecording: function(userInitiated)
615 { 613 {
616 console.assert(!this._statusPane, "Status pane is already opened."); 614 console.assert(!this._statusPane, "Status pane is already opened.");
615 var mainTarget = WebInspector.targetManager.mainTarget();
616 if (!mainTarget)
617 return;
617 this._setState(WebInspector.TimelinePanel.State.StartPending); 618 this._setState(WebInspector.TimelinePanel.State.StartPending);
618 this._showRecordingStarted(); 619 this._showRecordingStarted();
619 620
620 this._autoRecordGeneration = userInitiated ? null : Symbol("Generation") ; 621 this._autoRecordGeneration = userInitiated ? null : Symbol("Generation") ;
622 this._controller = new WebInspector.TimelineController(mainTarget, this, this._tracingModel);
621 this._controller.startRecording(true, this._captureJSProfileSetting.get( ), this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting.get() , this._captureFilmStripSetting && this._captureFilmStripSetting.get()); 623 this._controller.startRecording(true, this._captureJSProfileSetting.get( ), this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting.get() , this._captureFilmStripSetting && this._captureFilmStripSetting.get());
622 624
623 for (var i = 0; i < this._overviewControls.length; ++i) 625 for (var i = 0; i < this._overviewControls.length; ++i)
624 this._overviewControls[i].timelineStarted(); 626 this._overviewControls[i].timelineStarted();
625 627
626 if (userInitiated) 628 if (userInitiated)
627 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action .TimelineStarted); 629 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action .TimelineStarted);
628 this._setUIControlsEnabled(false); 630 this._setUIControlsEnabled(false);
629 this._hideRecordingHelpMessage(); 631 this._hideRecordingHelpMessage();
630 }, 632 },
631 633
632 _stopRecording: function() 634 _stopRecording: function()
633 { 635 {
634 if (this._statusPane) { 636 if (this._statusPane) {
635 this._statusPane.finish(); 637 this._statusPane.finish();
636 this._statusPane.updateStatus(WebInspector.UIString("Stopping timeli ne\u2026")); 638 this._statusPane.updateStatus(WebInspector.UIString("Stopping timeli ne\u2026"));
637 this._statusPane.updateProgressBar(WebInspector.UIString("Received") , 0); 639 this._statusPane.updateProgressBar(WebInspector.UIString("Received") , 0);
638 } 640 }
639 this._setState(WebInspector.TimelinePanel.State.StopPending); 641 this._setState(WebInspector.TimelinePanel.State.StopPending);
640 this._autoRecordGeneration = null; 642 this._autoRecordGeneration = null;
641 this._controller.stopRecording(); 643 this._controller.stopRecording();
644 this._controller = null;
642 this._setUIControlsEnabled(true); 645 this._setUIControlsEnabled(true);
643 }, 646 },
644 647
645 _onSuspendStateChanged: function() 648 _onSuspendStateChanged: function()
646 { 649 {
647 this._updateTimelineControls(); 650 this._updateTimelineControls();
648 }, 651 },
649 652
650 _updateTimelineControls: function() 653 _updateTimelineControls: function()
651 { 654 {
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 * @override 2203 * @override
2201 * @param {!WebInspector.Target} target 2204 * @param {!WebInspector.Target} target
2202 */ 2205 */
2203 targetRemoved: function(target) 2206 targetRemoved: function(target)
2204 { 2207 {
2205 this._targets.remove(target, true); 2208 this._targets.remove(target, true);
2206 }, 2209 },
2207 2210
2208 __proto__: WebInspector.Object.prototype 2211 __proto__: WebInspector.Object.prototype
2209 } 2212 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698