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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/extensions/ExtensionAPI.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 PreviousSearchResult: "previousSearchResult" 49 PreviousSearchResult: "previousSearchResult"
50 }; 50 };
51 51
52 apiPrivate.Events = { 52 apiPrivate.Events = {
53 AuditStarted: "audit-started-", 53 AuditStarted: "audit-started-",
54 ButtonClicked: "button-clicked-", 54 ButtonClicked: "button-clicked-",
55 PanelObjectSelected: "panel-objectSelected-", 55 PanelObjectSelected: "panel-objectSelected-",
56 NetworkRequestFinished: "network-request-finished", 56 NetworkRequestFinished: "network-request-finished",
57 OpenResource: "open-resource", 57 OpenResource: "open-resource",
58 PanelSearch: "panel-search-", 58 PanelSearch: "panel-search-",
59 RecordingStarted: "trace-recording-started-",
60 RecordingStopped: "trace-recording-stopped-",
59 ResourceAdded: "resource-added", 61 ResourceAdded: "resource-added",
60 ResourceContentCommitted: "resource-content-committed", 62 ResourceContentCommitted: "resource-content-committed",
61 ViewShown: "view-shown-", 63 ViewShown: "view-shown-",
62 ViewHidden: "view-hidden-" 64 ViewHidden: "view-hidden-"
63 }; 65 };
64 66
65 apiPrivate.Commands = { 67 apiPrivate.Commands = {
66 AddAuditCategory: "addAuditCategory", 68 AddAuditCategory: "addAuditCategory",
67 AddAuditResult: "addAuditResult", 69 AddAuditResult: "addAuditResult",
68 AddRequestHeaders: "addRequestHeaders", 70 AddRequestHeaders: "addRequestHeaders",
71 AddTraceProvider: "addTraceProvider",
69 ApplyStyleSheet: "applyStyleSheet", 72 ApplyStyleSheet: "applyStyleSheet",
70 CreatePanel: "createPanel", 73 CreatePanel: "createPanel",
71 CreateSidebarPane: "createSidebarPane", 74 CreateSidebarPane: "createSidebarPane",
72 CreateToolbarButton: "createToolbarButton", 75 CreateToolbarButton: "createToolbarButton",
73 EvaluateOnInspectedPage: "evaluateOnInspectedPage", 76 EvaluateOnInspectedPage: "evaluateOnInspectedPage",
74 ForwardKeyboardEvent: "_forwardKeyboardEvent", 77 ForwardKeyboardEvent: "_forwardKeyboardEvent",
75 GetHAR: "getHAR", 78 GetHAR: "getHAR",
76 GetPageResources: "getPageResources", 79 GetPageResources: "getPageResources",
77 GetRequestContent: "getRequestContent", 80 GetRequestContent: "getRequestContent",
78 GetResourceContent: "getResourceContent", 81 GetResourceContent: "getResourceContent",
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 173
171 /** 174 /**
172 * @constructor 175 * @constructor
173 */ 176 */
174 function InspectorExtensionAPI() 177 function InspectorExtensionAPI()
175 { 178 {
176 this.audits = new Audits(); 179 this.audits = new Audits();
177 this.inspectedWindow = new InspectedWindow(); 180 this.inspectedWindow = new InspectedWindow();
178 this.panels = new Panels(); 181 this.panels = new Panels();
179 this.network = new Network(); 182 this.network = new Network();
183 this.timeline = new Timeline();
180 defineDeprecatedProperty(this, "webInspector", "resources", "network"); 184 defineDeprecatedProperty(this, "webInspector", "resources", "network");
181 } 185 }
182 186
183 /** 187 /**
184 * @constructor 188 * @constructor
185 */ 189 */
186 function Network() 190 function Network()
187 { 191 {
188 /** 192 /**
189 * @this {EventSinkImpl} 193 * @this {EventSinkImpl}
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 tooltip: tooltipText, 550 tooltip: tooltipText,
547 disabled: !!disabled 551 disabled: !!disabled
548 }; 552 };
549 extensionServer.sendRequest(request); 553 extensionServer.sendRequest(request);
550 } 554 }
551 }; 555 };
552 556
553 /** 557 /**
554 * @constructor 558 * @constructor
555 */ 559 */
560 function Timeline()
561 {
562 }
563
564 Timeline.prototype = {
565 /**
566 * @param {string} categoryName
567 * @param {string} categoryTooltip
568 * @return {!TraceProvider}
569 */
570 addTraceProvider: function(categoryName, categoryTooltip)
571 {
572 var id = "extension-timeline-category-" + extensionServer.nextObjectId() ;
573 extensionServer.sendRequest({ command: commands.AddTraceProvider, id: id , categoryName: categoryName, categoryTooltip: categoryTooltip});
574 return new TraceProvider(id);
575 }
576 }
577
578 /**
579 * @constructor
580 */
581 function TraceProvider(id)
582 {
583 this.onRecordingStarted = new EventSink(events.RecordingStarted + id);
584 this.onRecordingStopped = new EventSink(events.RecordingStopped + id);
585 }
586
587 /**
588 * @constructor
589 */
556 function Audits() 590 function Audits()
557 { 591 {
558 } 592 }
559 593
560 Audits.prototype = { 594 Audits.prototype = {
561 /** 595 /**
562 * @return {!AuditCategory} 596 * @return {!AuditCategory}
563 */ 597 */
564 addCategory: function(displayName, resultCount) 598 addCategory: function(displayName, resultCount)
565 { 599 {
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 { 1050 {
1017 return "(function(injectedScriptId){ " + 1051 return "(function(injectedScriptId){ " +
1018 "var extensionServer;" + 1052 "var extensionServer;" +
1019 defineCommonExtensionSymbols.toString() + ";" + 1053 defineCommonExtensionSymbols.toString() + ";" +
1020 injectedExtensionAPI.toString() + ";" + 1054 injectedExtensionAPI.toString() + ";" +
1021 buildPlatformExtensionAPI(extensionInfo, inspectedTabId) + ";" + 1055 buildPlatformExtensionAPI(extensionInfo, inspectedTabId) + ";" +
1022 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + 1056 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" +
1023 "return {};" + 1057 "return {};" +
1024 "})"; 1058 "})";
1025 } 1059 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698