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

Unified Diff: Source/devtools/front_end/TimelineModel.js

Issue 213003002: DevTools: allow whitelist of timeline events to be pushed live although in bufferEvent mode. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Same with front-end Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/TimelineManager.js ('k') | Source/devtools/front_end/TimelinePanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TimelineModel.js
diff --git a/Source/devtools/front_end/TimelineModel.js b/Source/devtools/front_end/TimelineModel.js
index 7c43529dc518bd8a35bfa1a17a54997aa8e26e57..a289e5e8a6ecd969fc03c3b61a266fbd2e83f0f4 100644
--- a/Source/devtools/front_end/TimelineModel.js
+++ b/Source/devtools/front_end/TimelineModel.js
@@ -213,23 +213,25 @@ WebInspector.TimelineModel.prototype = {
this.dispatchEventToListeners(WebInspector.TimelineModel.Events.RecordFilterChanged);
},
- /**
- * @param {boolean=} includeCounters
- */
- startRecording: function(includeCounters)
+ startRecording: function()
{
this._clientInitiatedRecording = true;
this.reset();
var maxStackFrames = WebInspector.settings.timelineCaptureStacks.get() ? 30 : 0;
- var bufferEvents = WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled() && !WebInspector.settings.timelineLiveUpdate.get();
+ this._bufferEvents = WebInspector.experimentsSettings.timelineNoLiveUpdate.isEnabled() && !WebInspector.settings.timelineLiveUpdate.get();
var includeGPUEvents = WebInspector.experimentsSettings.gpuTimeline.isEnabled();
- WebInspector.timelineManager.start(maxStackFrames, bufferEvents, includeCounters, includeGPUEvents, this._fireRecordingStarted.bind(this));
+ var liveEvents = [ WebInspector.TimelineModel.RecordType.BeginFrame,
+ WebInspector.TimelineModel.RecordType.DrawFrame,
caseq 2014/03/26 16:21:06 Wring indent
+ WebInspector.TimelineModel.RecordType.RequestMainThreadFrame,
+ WebInspector.TimelineModel.RecordType.ActivateLayerTree ];
+ var includeCounters = true;
+ WebInspector.timelineManager.start(maxStackFrames, this._bufferEvents, liveEvents.join(","), includeCounters, includeGPUEvents, this._fireRecordingStarted.bind(this));
},
stopRecording: function()
{
if (!this._clientInitiatedRecording) {
- WebInspector.timelineManager.start(undefined, undefined, undefined, undefined, stopTimeline.bind(this));
+ WebInspector.timelineManager.start(undefined, undefined, undefined, undefined, undefined, stopTimeline.bind(this));
return;
}
@@ -298,13 +300,25 @@ WebInspector.TimelineModel.prototype = {
*/
_fireRecordingStopped: function(error, events)
{
+ this._bufferEvents = false;
this._collectionEnabled = false;
- for (var i = 0; events && i < events.length; ++i)
- this._addRecord(events[i]);
+ if (events && events.length) {
+ this.reset();
+ for (var i = 0; i < events.length; ++i)
+ this._addRecord(events[i]);
+ }
this.dispatchEventToListeners(WebInspector.TimelineModel.Events.RecordingStopped);
},
/**
+ * @return {boolean}
+ */
+ bufferEvents: function()
+ {
+ return this._bufferEvents;
+ },
+
+ /**
* @param {!TimelineAgent.TimelineEvent} payload
*/
_addRecord: function(payload)
« no previous file with comments | « Source/devtools/front_end/TimelineManager.js ('k') | Source/devtools/front_end/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698