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

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

Issue 2128133002: Timeline AddTraceProvider API Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Timeline AddTraceProvider API Created 4 years, 5 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/ExtensionServer.js
diff --git a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionServer.js b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionServer.js
index 6eccd285e34f85ef0ce873884ed56422ffcb8ff1..713d2986e60c3cd8e34222e989bf24ab8d614a14 100644
--- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionServer.js
+++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionServer.js
@@ -49,12 +49,15 @@ WebInspector.ExtensionServer = function()
this._sidebarPanes = [];
/** @type {!Array.<!WebInspector.ExtensionAuditCategory>} */
this._auditCategories = [];
+ /** @type {!Array.<!WebInspector.ExtensionTraceProvider>} */
+ this._traceProviders = [];
var commands = WebInspector.extensionAPI.Commands;
this._registerHandler(commands.AddAuditCategory, this._onAddAuditCategory.bind(this));
this._registerHandler(commands.AddAuditResult, this._onAddAuditResult.bind(this));
this._registerHandler(commands.AddRequestHeaders, this._onAddRequestHeaders.bind(this));
+ this._registerHandler(commands.AddTraceProvider, this._onAddTraceProvider.bind(this));
this._registerHandler(commands.ApplyStyleSheet, this._onApplyStyleSheet.bind(this));
this._registerHandler(commands.CreatePanel, this._onCreatePanel.bind(this));
this._registerHandler(commands.CreateSidebarPane, this._onCreateSidebarPane.bind(this));
@@ -87,7 +90,8 @@ WebInspector.ExtensionServer = function()
WebInspector.ExtensionServer.Events = {
SidebarPaneAdded: "SidebarPaneAdded",
- AuditCategoryAdded: "AuditCategoryAdded"
+ AuditCategoryAdded: "AuditCategoryAdded",
+ TraceProviderAdded: "TraceProviderAdded"
}
WebInspector.ExtensionServer.prototype = {
@@ -150,7 +154,6 @@ WebInspector.ExtensionServer.prototype = {
this._postNotification(WebInspector.extensionAPI.Events.InspectedURLChanged, url);
},
-
/**
* @param {string} categoryId
* @param {!WebInspector.ExtensionAuditCategoryResults} auditResults
@@ -162,6 +165,14 @@ WebInspector.ExtensionServer.prototype = {
},
/**
+ * @param {string} traceProviderId
+ */
+ startTraceRecording: function(traceProviderId)
+ {
+ this._postNotification("trace-recording-started-" + traceProviderId);
+ },
+
+ /**
* @param {!WebInspector.ExtensionAuditCategoryResults} auditResults
*/
stopAuditRun: function(auditResults)
@@ -170,6 +181,14 @@ WebInspector.ExtensionServer.prototype = {
},
/**
+ * @param {string} traceProviderId
+ */
+ stopTraceRecording: function(traceProviderId)
caseq 2016/07/19 22:01:16 nit: please group together with startTraceRecordin
+ {
+ this._postNotification("trace-recording-stopped-" + traceProviderId);
+ },
+
+ /**
* @param {string} type
* @return {boolean}
*/
@@ -582,6 +601,22 @@ WebInspector.ExtensionServer.prototype = {
this.dispatchEventToListeners(WebInspector.ExtensionServer.Events.AuditCategoryAdded, category);
},
+ _onAddTraceProvider: function(message, port)
+ {
+ var provider = new WebInspector.ExtensionTraceProvider(port._extensionOrigin, message.id, message.categoryName, message.categoryTooltip);
+ this._clientObjects[message.id] = provider;
+ this._traceProviders.push(provider);
+ this.dispatchEventToListeners(WebInspector.ExtensionServer.Events.TraceProviderAdded, provider);
caseq 2016/07/19 22:01:16 is this used?
+ },
+
+ /**
+ * @return {!Array.<!WebInspector.ExtensionTraceProvider>}
+ */
+ traceProviders: function()
+ {
+ return this._traceProviders;
+ },
+
/**
* @return {!Array.<!WebInspector.ExtensionAuditCategory>}
*/

Powered by Google App Engine
This is Rietveld 408576698