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

Unified Diff: third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js

Issue 2375653003: DevTools: add an API for extension-supplied trace providers (Closed)
Patch Set: review comments addressed Created 4 years, 3 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
Index: third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
index 44756521a0616dcad3f8e0cc7008babb4153dae5..86e525307110c0654c46395f53bf175430ada4a2 100644
--- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
+++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
@@ -57,6 +57,8 @@ function defineCommonExtensionSymbols(apiPrivate)
NetworkRequestFinished: "network-request-finished",
OpenResource: "open-resource",
PanelSearch: "panel-search-",
+ RecordingStarted: "trace-recording-started-",
+ RecordingStopped: "trace-recording-stopped-",
ResourceAdded: "resource-added",
ResourceContentCommitted: "resource-content-committed",
ViewShown: "view-shown-",
@@ -68,6 +70,7 @@ function defineCommonExtensionSymbols(apiPrivate)
AddAuditCategory: "addAuditCategory",
AddAuditResult: "addAuditResult",
AddRequestHeaders: "addRequestHeaders",
+ AddTraceProvider: "addTraceProvider",
ApplyStyleSheet: "applyStyleSheet",
CreatePanel: "createPanel",
CreateSidebarPane: "createSidebarPane",
@@ -183,6 +186,7 @@ function InspectorExtensionAPI()
this.inspectedWindow = new InspectedWindow();
this.panels = new Panels();
this.network = new Network();
+ this.timeline = new Timeline();
defineDeprecatedProperty(this, "webInspector", "resources", "network");
}
@@ -549,6 +553,37 @@ ButtonImpl.prototype = {
/**
* @constructor
*/
+function Timeline()
+{
+}
+
+Timeline.prototype = {
+ /**
+ * @param {string} categoryName
+ * @param {string} categoryTooltip
+ * @return {!TraceProvider}
+ */
+ addTraceProvider: function(categoryName, categoryTooltip)
+ {
+ var id = "extension-trace-provider-" + extensionServer.nextObjectId();
+ extensionServer.sendRequest({ command: commands.AddTraceProvider, id: id, categoryName: categoryName, categoryTooltip: categoryTooltip});
+ return new TraceProvider(id);
+ }
+}
+
+/**
+ * @constructor
+ * @param {string} id
+ */
+function TraceProvider(id)
+{
+ this.onRecordingStarted = new EventSink(events.RecordingStarted + id);
+ this.onRecordingStopped = new EventSink(events.RecordingStopped + id);
+}
+
+/**
+ * @constructor
+ */
function Audits()
{
}

Powered by Google App Engine
This is Rietveld 408576698