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

Unified Diff: third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.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/extensions/ExtensionTraceProvider.js
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.js
index b480c15cafe276d48f6bf805642778c007741de6..6a93dacbb99a21b3ade70bf449461688c7512a1d 100644
--- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.js
+++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionTraceProvider.js
@@ -1,3 +1,7 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
/**
* @unrestricted
*/
@@ -14,11 +18,52 @@ Extensions.ExtensionTraceProvider = class {
this._categoryName = categoryName;
this._categoryTooltip = categoryTooltip;
}
- start() {
- Extensions.extensionServer.startTraceRecording(this._id);
+
+ /**
+ * @param {!Extensions.TracingSession} session
+ */
+ start(session) {
+ var sessionId = String(++Extensions.ExtensionTraceProvider._lastSessionId);
+ Extensions.extensionServer.startTraceRecording(this._id, sessionId, session);
}
stop() {
Extensions.extensionServer.stopTraceRecording(this._id);
}
+
+ /**
+ * @return {string}
+ */
+ shortDisplayName() {
+ return this._categoryName;
+ }
+
+ /**
+ * @return {string}
+ */
+ longDisplayName() {
+ return this._categoryTooltip;
+ }
+
+ /**
+ * @return {string}
+ */
+ persistentIdentifier() {
+ return `${this._extensionOrigin}/${this._categoryName}`;
+ }
+};
+
+Extensions.ExtensionTraceProvider._lastSessionId = 0;
+
+/**
+ * @interface
+ */
+Extensions.TracingSession = function() {};
+
+Extensions.TracingSession.prototype = {
+ /**
+ * @param {string} url
+ * @param {number} timeOffsetMicroseconds
+ */
+ complete: function(url, timeOffsetMicroseconds) {}
};

Powered by Google App Engine
This is Rietveld 408576698