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

Unified Diff: Source/devtools/front_end/sdk/TracingManager.js

Issue 722693002: DevTools: show progress when retrieving recorded trace events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | « no previous file | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/TracingManager.js
diff --git a/Source/devtools/front_end/sdk/TracingManager.js b/Source/devtools/front_end/sdk/TracingManager.js
index 204a6edd50d6b47201d0c21c406930e0397f33b8..eb1626d070514507b00eb0feb78ca1b95495f2de 100644
--- a/Source/devtools/front_end/sdk/TracingManager.js
+++ b/Source/devtools/front_end/sdk/TracingManager.js
@@ -13,10 +13,13 @@ WebInspector.TracingManager = function()
{
WebInspector.Object.call(this);
this._active = false;
+ this._eventBufferSize = 0;
+ this._eventsRetrieved = 0;
WebInspector.targetManager.observeTargets(this);
}
WebInspector.TracingManager.Events = {
+ "RetrieveEventsProgress": "RetrieveEventsProgress",
"BufferUsage": "BufferUsage",
"TracingStarted": "TracingStarted",
"EventsCollected": "EventsCollected",
@@ -70,11 +73,14 @@ WebInspector.TracingManager.prototype = {
},
/**
- * @param {number} usage
+ * @param {number=} usage
+ * @param {number=} eventCount
+ * @param {number=} percentFull
*/
- _bufferUsage: function(usage)
+ _bufferUsage: function(usage, eventCount, percentFull)
{
- this.dispatchEventToListeners(WebInspector.TracingManager.Events.BufferUsage, usage);
+ this._eventBufferSize = eventCount;
+ this.dispatchEventToListeners(WebInspector.TracingManager.Events.BufferUsage, usage || percentFull);
},
/**
@@ -83,10 +89,18 @@ WebInspector.TracingManager.prototype = {
_eventsCollected: function(events)
{
this.dispatchEventToListeners(WebInspector.TracingManager.Events.EventsCollected, events);
+ this._eventsRetrieved += events.length;
+ if (!this._eventBufferSize)
+ return;
+ if (this._eventsRetrieved > this._eventBufferSize)
+ this._eventsRetrieved = this._eventBufferSize;
+ this.dispatchEventToListeners(WebInspector.TracingManager.Events.RetrieveEventsProgress, this._eventsRetrieved / this._eventBufferSize);
},
_tracingComplete: function()
{
+ this._eventBufferSize = 0;
+ this._eventsRetrieved = 0;
this.dispatchEventToListeners(WebInspector.TracingManager.Events.TracingComplete);
},
@@ -137,11 +151,13 @@ WebInspector.TracingDispatcher = function(tracingManager)
WebInspector.TracingDispatcher.prototype = {
/**
- * @param {number} usage
+ * @param {number=} usage
+ * @param {number=} eventCount
+ * @param {number=} percentFull
*/
- bufferUsage: function(usage)
+ bufferUsage: function(usage, eventCount, percentFull)
{
- this._tracingManager._bufferUsage(usage);
+ this._tracingManager._bufferUsage(usage, eventCount, percentFull);
},
/**
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698