| 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);
|
| },
|
|
|
| /**
|
|
|