Chromium Code Reviews| 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..cf8a1f9bb33d6e642a76836fd859d7e00df9b5ff 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,36 @@ ButtonImpl.prototype = { |
| /** |
| * @constructor |
| */ |
| +function Timeline() |
| +{ |
| +} |
| + |
| +Timeline.prototype = { |
| + /** |
| + * @param {string} categoryName |
| + * @param {string} categoryTooltip |
| + * @return {!TraceProvider} |
| + */ |
| + addTraceProvider: function(categoryName, categoryTooltip) |
| + { |
| + var id = "extension-timeline-category-" + extensionServer.nextObjectId(); |
| + extensionServer.sendRequest({ command: commands.AddTraceProvider, id: id, categoryName: categoryName, categoryTooltip: categoryTooltip}); |
| + return new TraceProvider(id); |
| + } |
| +} |
| + |
| +/** |
| + * @constructor |
| + */ |
| +function TraceProvider(id) |
|
alph
2016/09/27 23:11:54
nit: annotate
|
| +{ |
| + this.onRecordingStarted = new EventSink(events.RecordingStarted + id); |
| + this.onRecordingStopped = new EventSink(events.RecordingStopped + id); |
| +} |
| + |
| +/** |
| + * @constructor |
| + */ |
| function Audits() |
| { |
| } |