Chromium Code Reviews| 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..1af76dfc643ffb31d5d55e87d64867d0fbae6541 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,7 @@ WebInspector.ExtensionServer = function() |
| WebInspector.ExtensionServer.Events = { |
| SidebarPaneAdded: "SidebarPaneAdded", |
| - AuditCategoryAdded: "AuditCategoryAdded" |
| + AuditCategoryAdded: "AuditCategoryAdded", |
| } |
| WebInspector.ExtensionServer.prototype = { |
| @@ -150,7 +153,6 @@ WebInspector.ExtensionServer.prototype = { |
| this._postNotification(WebInspector.extensionAPI.Events.InspectedURLChanged, url); |
| }, |
| - |
| /** |
| * @param {string} categoryId |
| * @param {!WebInspector.ExtensionAuditCategoryResults} auditResults |
| @@ -161,7 +163,7 @@ WebInspector.ExtensionServer.prototype = { |
| this._postNotification("audit-started-" + categoryId, auditResults.id()); |
| }, |
| - /** |
| + /** |
|
caseq
2016/07/20 22:51:49
revert this one.
|
| * @param {!WebInspector.ExtensionAuditCategoryResults} auditResults |
| */ |
| stopAuditRun: function(auditResults) |
| @@ -170,6 +172,22 @@ WebInspector.ExtensionServer.prototype = { |
| }, |
| /** |
| + * @param {string} traceProviderId |
| + */ |
| + startTraceRecording: function(traceProviderId) |
| + { |
| + this._postNotification("trace-recording-started-" + traceProviderId); |
| + }, |
| + |
| + /** |
| + * @param {string} traceProviderId |
| + */ |
| + stopTraceRecording: function(traceProviderId) |
| + { |
| + this._postNotification("trace-recording-stopped-" + traceProviderId); |
| + }, |
| + |
| + /** |
| * @param {string} type |
| * @return {boolean} |
| */ |
| @@ -582,6 +600,21 @@ WebInspector.ExtensionServer.prototype = { |
| this.dispatchEventToListeners(WebInspector.ExtensionServer.Events.AuditCategoryAdded, category); |
| }, |
| + _onAddTraceProvider: function(message, port) |
|
alph
2016/07/21 17:06:23
nit: please annotate
|
| + { |
| + var provider = new WebInspector.ExtensionTraceProvider(port._extensionOrigin, message.id, message.categoryName, message.categoryTooltip); |
| + this._clientObjects[message.id] = provider; |
| + this._traceProviders.push(provider); |
| + }, |
| + |
| + /** |
| + * @return {!Array.<!WebInspector.ExtensionTraceProvider>} |
|
caseq
2016/07/20 22:51:49
nit: drop ., just !Array<!WebInspector.ExtensionTr
|
| + */ |
| + traceProviders: function() |
| + { |
| + return this._traceProviders; |
| + }, |
| + |
| /** |
| * @return {!Array.<!WebInspector.ExtensionAuditCategory>} |
| */ |