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

Unified Diff: Source/devtools/front_end/timeline/TimelineModelImpl.js

Issue 399043002: DevTools: switch Timeline frontend into buffered mode and remove the corresponding experiment. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: timeline-websocket-event rebaselined Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/timeline/TimelineModelImpl.js
diff --git a/Source/devtools/front_end/timeline/TimelineModelImpl.js b/Source/devtools/front_end/timeline/TimelineModelImpl.js
index c7bcade488ca32e57f65902e046aa45ce03b3553..a4901bc526e3f224aae6fb2ae19b1ef8f45fe3fa 100644
--- a/Source/devtools/front_end/timeline/TimelineModelImpl.js
+++ b/Source/devtools/front_end/timeline/TimelineModelImpl.js
@@ -20,6 +20,7 @@ WebInspector.TimelineModelImpl = function()
WebInspector.targetManager.addModelListener(WebInspector.TimelineManager, WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, this._onRecordAdded, this);
WebInspector.targetManager.addModelListener(WebInspector.TimelineManager, WebInspector.TimelineManager.EventTypes.TimelineStarted, this._onStarted, this);
WebInspector.targetManager.addModelListener(WebInspector.TimelineManager, WebInspector.TimelineManager.EventTypes.TimelineStopped, this._onStopped, this);
+ WebInspector.targetManager.addModelListener(WebInspector.TimelineManager, WebInspector.TimelineManager.EventTypes.TimelineAllEventsReceived, this._onAllEventsReceived, this);
WebInspector.targetManager.addModelListener(WebInspector.TimelineManager, WebInspector.TimelineManager.EventTypes.TimelineProgress, this._onProgress, this);
WebInspector.targetManager.observeTargets(this);
}
@@ -60,7 +61,7 @@ WebInspector.TimelineModelImpl.prototype = {
WebInspector.TimelineModel.RecordType.DrawFrame,
WebInspector.TimelineModel.RecordType.RequestMainThreadFrame,
WebInspector.TimelineModel.RecordType.ActivateLayerTree ];
- this._currentTarget.timelineManager.start(maxStackFrames, WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled(), liveEvents.join(","), captureMemory, includeGPUEvents, this._fireRecordingStarted.bind(this));
+ this._currentTarget.timelineManager.start(maxStackFrames, liveEvents.join(","), captureMemory, includeGPUEvents, this._fireRecordingStarted.bind(this));
},
stopRecording: function()
@@ -69,7 +70,7 @@ WebInspector.TimelineModelImpl.prototype = {
return;
if (!this._clientInitiatedRecording) {
- this._currentTarget.timelineManager.start(undefined, undefined, undefined, undefined, undefined, stopTimeline.bind(this));
+ this._currentTarget.timelineManager.start(undefined, undefined, undefined, undefined, stopTimeline.bind(this));
return;
}
@@ -129,11 +130,9 @@ WebInspector.TimelineModelImpl.prototype = {
var timelineManager = /** @type {!WebInspector.TimelineManager} */ (event.target);
if (timelineManager.target() !== this._currentTarget)
return;
- // If we were buffering events, discard those that got through, the real ones are coming!
- if (WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled()) {
- this.reset();
- this._currentTarget = timelineManager.target();
- }
+ // We were buffering events, discard those that got through, the real ones are coming!
+ this.reset();
+ this._currentTarget = timelineManager.target();
if (event.data) {
// Stopped from console.
this._fireRecordingStopped(null, null);
@@ -143,6 +142,17 @@ WebInspector.TimelineModelImpl.prototype = {
/**
* @param {!WebInspector.Event} event
*/
+ _onAllEventsReceived: function(event)
+ {
+ var timelineManager = /** @type {!WebInspector.TimelineManager} */ (event.target);
+ if (timelineManager.target() !== this._currentTarget)
+ return;
+ this._collectionEnabled = false;
+ },
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
_onProgress: function(event)
{
var timelineManager = /** @type {!WebInspector.TimelineManager} */ (event.target);
@@ -162,7 +172,6 @@ WebInspector.TimelineModelImpl.prototype = {
*/
_fireRecordingStopped: function(error, cpuProfile)
{
- this._collectionEnabled = false;
if (cpuProfile)
WebInspector.TimelineJSProfileProcessor.mergeJSProfileIntoTimeline(this, cpuProfile);
this.dispatchEventToListeners(WebInspector.TimelineModel.Events.RecordingStopped);
« no previous file with comments | « Source/devtools/front_end/sdk/TimelineManager.js ('k') | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698