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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js

Issue 2563383003: DevTools: add extension API to contribute trace events to timeline (Closed)
Patch Set: lint + new compiler warnings Created 4 years 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: third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js
index 5e77ce7990178a72e331a0835549764f65bde8e1..996fc50311f94ae9feac104e0ecd159c9af2f65d 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/TracingModel.js
@@ -169,6 +169,28 @@ SDK.TracingModel = class {
}
/**
+ * @param {number} offset
+ */
+ adjustTime(offset) {
+ this._minimumRecordTime += offset;
+ this._maximumRecordTime += offset;
+ for (const process of this._processById.values()) {
+ for (const thread of process._threads.values()) {
+ for (const event of thread.events()) {
+ event.startTime += offset;
+ if (typeof event.endTime === 'number')
+ event.endTime += offset;
+ }
+ for (const event of thread.asyncEvents()) {
+ event.startTime += offset;
+ if (typeof event.endTime === 'number')
+ event.endTime += offset;
+ }
+ }
+ }
+ }
+
+ /**
* @param {!SDK.TracingManager.EventPayload} payload
*/
_addEvent(payload) {
@@ -474,7 +496,7 @@ SDK.BackingStorage.prototype = {
finishWriting() {},
- reset() {},
+ reset() {}
};
/**
@@ -612,10 +634,6 @@ SDK.TracingModel.Event = class {
}
};
-
-/**
- * @unrestricted
- */
SDK.TracingModel.ObjectSnapshot = class extends SDK.TracingModel.Event {
/**
* @param {string} category
@@ -625,6 +643,12 @@ SDK.TracingModel.ObjectSnapshot = class extends SDK.TracingModel.Event {
*/
constructor(category, name, startTime, thread) {
super(category, name, SDK.TracingModel.Phase.SnapshotObject, startTime, thread);
+ /** @type {?function():!Promise<?string>} */
+ this._backingStorage = null;
+ /** @type {string} */
+ this.id;
+ /** @type {?Promise<?>} */
+ this._objectPromise = null;
}
/**
@@ -743,11 +767,19 @@ SDK.TracingModel.ProfileEventsGroup = class {
}
};
-/**
- * @unrestricted
- */
SDK.TracingModel.NamedObject = class {
/**
+ * @param {!SDK.TracingModel} model
+ * @param {number} id
+ */
+ constructor(model, id) {
+ this._model = model;
+ this._id = id;
+ this._name = '';
+ this._sortIndex = 0;
+ }
+
+ /**
* @param {!Array.<!SDK.TracingModel.NamedObject>} array
*/
static _sort(array) {
@@ -783,23 +815,16 @@ SDK.TracingModel.NamedObject = class {
}
};
-
-/**
- * @unrestricted
- */
SDK.TracingModel.Process = class extends SDK.TracingModel.NamedObject {
/**
* @param {!SDK.TracingModel} model
* @param {number} id
*/
constructor(model, id) {
- super();
- this._setName('Process ' + id);
- this._id = id;
+ super(model, id);
/** @type {!Map<number, !SDK.TracingModel.Thread>} */
this._threads = new Map();
this._threadByName = new Map();
- this._model = model;
}
/**
@@ -854,22 +879,17 @@ SDK.TracingModel.Process = class extends SDK.TracingModel.NamedObject {
}
};
-/**
- * @unrestricted
- */
SDK.TracingModel.Thread = class extends SDK.TracingModel.NamedObject {
/**
* @param {!SDK.TracingModel.Process} process
* @param {number} id
*/
constructor(process, id) {
- super();
+ super(process._model, id);
this._process = process;
- this._setName('Thread ' + id);
this._events = [];
this._asyncEvents = [];
- this._id = id;
- this._model = process._model;
+ this._lastTopLevelEvent = null;
}
tracingComplete() {

Powered by Google App Engine
This is Rietveld 408576698