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

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

Issue 212683005: Timeline Trace viewer prototype (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased, extracted model into a file of its own 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/TimelineView.js ('k') | Source/devtools/front_end/TracingModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TracingAgent.js
diff --git a/Source/devtools/front_end/TracingAgent.js b/Source/devtools/front_end/TracingAgent.js
index e7ad664f91a48cede2ca1a3581f2773cd58adfe4..964aad3dbb4414d5b696ecf1bb4ce3918cc83bca 100644
--- a/Source/devtools/front_end/TracingAgent.js
+++ b/Source/devtools/front_end/TracingAgent.js
@@ -30,13 +30,64 @@
/**
* @constructor
+ * @extends {WebInspector.Object}
*/
WebInspector.TracingAgent = function()
{
+ WebInspector.Object.call(this);
this._active = false;
InspectorBackend.registerTracingDispatcher(new WebInspector.TracingDispatcher(this));
}
+WebInspector.TracingAgent.Events = {
+ EventsCollected: "EventsCollected"
+};
+
+/** @typedef {!{
+ cat: string,
+ pid: number,
+ tid: number,
+ ts: number,
+ ph: string,
+ name: string,
+ args: !Object,
+ dur: number,
+ id: number,
+ s: string
+ }}
+ */
+WebInspector.TracingAgent.Event;
+
+/**
+ * @enum {string}
+ */
+WebInspector.TracingAgent.Phase = {
+ Begin: "B",
+ End: "E",
+ Complete: "X",
+ Instant: "i",
+ AsyncBegin: "S",
+ AsyncStepInto: "T",
+ AsyncStepPast: "p",
+ AsyncEnd: "F",
+ FlowBegin: "s",
+ FlowStep: "t",
+ FlowEnd: "f",
+ Metadata: "M",
+ Counter: "C",
+ Sample: "P",
+ CreateObject: "N",
+ SnapshotObject: "O",
+ DeleteObject: "D"
+};
+
+WebInspector.TracingAgent.MetadataEvent = {
+ ProcessSortIndex: "process_sort_index",
+ ProcessName: "process_name",
+ ThreadSortIndex: "thread_sort_index",
+ ThreadName: "thread_name"
+}
+
WebInspector.TracingAgent.prototype = {
/**
* @param {string} categoryPatterns
@@ -47,7 +98,6 @@ WebInspector.TracingAgent.prototype = {
{
TracingAgent.start(categoryPatterns, options, callback);
this._active = true;
- this._events = [];
},
/**
@@ -63,27 +113,21 @@ WebInspector.TracingAgent.prototype = {
TracingAgent.end();
},
- /**
- * @return {!Array.<!{cat: string, args: !Object, ph: string, ts: number}>}
- */
- events: function()
- {
- return this._events;
- },
-
_eventsCollected: function(events)
{
- Array.prototype.push.apply(this._events, events);
+ this.dispatchEventToListeners(WebInspector.TracingAgent.Events.EventsCollected, events);
},
_tracingComplete: function()
{
this._active = false;
- if (this._pendingStopCallback) {
- this._pendingStopCallback();
- this._pendingStopCallback = null;
- }
- }
+ if (!this._pendingStopCallback)
+ return;
+ this._pendingStopCallback();
+ this._pendingStopCallback = null;
+ },
+
+ __proto__: WebInspector.Object.prototype
}
/**
« no previous file with comments | « Source/devtools/front_end/TimelineView.js ('k') | Source/devtools/front_end/TracingModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698