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

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

Issue 2073343002: Timeline addTraceProvider API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: checkbox prototype Created 4 years, 6 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 7a9b305fbc76abcc0829e3ba5893acbb4068899f..07209785158c88f55940ea41399a07a0e540ac97 100644
--- a/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
+++ b/third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.js
@@ -51,6 +51,7 @@ function defineCommonExtensionSymbols(apiPrivate)
apiPrivate.Events = {
AuditStarted: "audit-started-",
+ RecordingStarted: "recording-started-",
caseq 2016/06/21 07:29:51 nit: "trace-recording-started-"
ButtonClicked: "button-clicked-",
PanelObjectSelected: "panel-objectSelected-",
NetworkRequestFinished: "network-request-finished",
@@ -66,6 +67,7 @@ function defineCommonExtensionSymbols(apiPrivate)
AddAuditCategory: "addAuditCategory",
AddAuditResult: "addAuditResult",
AddRequestHeaders: "addRequestHeaders",
+ AddTraceProvider: "addTraceProvider",
ApplyStyleSheet: "applyStyleSheet",
CreatePanel: "createPanel",
CreateSidebarPane: "createSidebarPane",
@@ -174,6 +176,7 @@ EventSinkImpl.prototype = {
function InspectorExtensionAPI()
{
this.audits = new Audits();
+ this.timeline = new Timeline();
this.inspectedWindow = new InspectedWindow();
this.panels = new Panels();
this.network = new Network();
@@ -553,6 +556,43 @@ 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)
+{
+ /**
+ * @this {EventSinkImpl}
+ */
+ function dispatchRecordingEvent(request)
caseq 2016/06/21 07:29:51 Looks like you don't need the custom dispatch call
+ {
+ this._fire();
+ }
+ this._id = id;
caseq 2016/06/21 07:29:51 do you need this?
+ this.onRecordingStarted = new EventSink(events.RecordingStarted + id, dispatchRecordingEvent);
+}
+
+/**
+ * @constructor
+ */
function Audits()
{
}

Powered by Google App Engine
This is Rietveld 408576698