Web Inspector: add timeline panel to the compilation.
https://bugs.webkit.org/show_bug.cgi?id=69628
Reviewed by Yury Semikhatsky.
* inspector/compile-front-end.sh:
* inspector/front-end/SidebarTreeElement.js:
(WebInspector.SidebarTreeElement):
* inspector/front-end/SourceCSSTokenizer.js:
(WebInspector.SourceCSSTokenizer.prototype.nextToken):
* inspector/front-end/SourceCSSTokenizer.re2js:
* inspector/front-end/SourceHTMLTokenizer.js:
(WebInspector.SourceHTMLTokenizer.prototype.nextToken):
* inspector/front-end/SourceHTMLTokenizer.re2js:
* inspector/front-end/SourceJavaScriptTokenizer.js:
(WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
* inspector/front-end/SourceJavaScriptTokenizer.re2js:
* inspector/front-end/TimelineGrid.js:
* inspector/front-end/TimelineOverviewPane.js:
(WebInspector.TimelineOverviewPane.prototype._createTimelineCategoryStatusBarCheckbox):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._createEventDivider):
(WebInspector.TimelinePanel.prototype._addRecordToTimeline):
(WebInspector.TimelinePanel.prototype._findParentRecord):
(WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
(WebInspector.TimelinePanel.prototype.updateMainViewWidth):
(WebInspector.TimelinePanel.prototype.onResize):
(WebInspector.TimelinePanel.prototype._windowChanged):
(WebInspector.TimelinePanel.prototype._refreshRecords):
(WebInspector.TimelineRecordGraphRow.prototype._onClick):
(WebInspector.TimelinePanel.FormattedRecord):
(WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
(WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96939 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index b82fdcc..23a3e55a 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,39 @@
+2011-10-07 Pavel Feldman <pfeldman@google.com>
+
+ Web Inspector: add timeline panel to the compilation.
+ https://bugs.webkit.org/show_bug.cgi?id=69628
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/compile-front-end.sh:
+ * inspector/front-end/SidebarTreeElement.js:
+ (WebInspector.SidebarTreeElement):
+ * inspector/front-end/SourceCSSTokenizer.js:
+ (WebInspector.SourceCSSTokenizer.prototype.nextToken):
+ * inspector/front-end/SourceCSSTokenizer.re2js:
+ * inspector/front-end/SourceHTMLTokenizer.js:
+ (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
+ * inspector/front-end/SourceHTMLTokenizer.re2js:
+ * inspector/front-end/SourceJavaScriptTokenizer.js:
+ (WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
+ * inspector/front-end/SourceJavaScriptTokenizer.re2js:
+ * inspector/front-end/TimelineGrid.js:
+ * inspector/front-end/TimelineOverviewPane.js:
+ (WebInspector.TimelineOverviewPane.prototype._createTimelineCategoryStatusBarCheckbox):
+ * inspector/front-end/TimelinePanel.js:
+ (WebInspector.TimelinePanel.prototype._createEventDivider):
+ (WebInspector.TimelinePanel.prototype._addRecordToTimeline):
+ (WebInspector.TimelinePanel.prototype._findParentRecord):
+ (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline):
+ (WebInspector.TimelinePanel.prototype.updateMainViewWidth):
+ (WebInspector.TimelinePanel.prototype.onResize):
+ (WebInspector.TimelinePanel.prototype._windowChanged):
+ (WebInspector.TimelinePanel.prototype._refreshRecords):
+ (WebInspector.TimelineRecordGraphRow.prototype._onClick):
+ (WebInspector.TimelinePanel.FormattedRecord):
+ (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent):
+ (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails):
+
2011-10-07 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r96892.
diff --git a/Source/WebCore/inspector/compile-front-end.sh b/Source/WebCore/inspector/compile-front-end.sh
index 206eb55..471e6c8 100755
--- a/Source/WebCore/inspector/compile-front-end.sh
+++ b/Source/WebCore/inspector/compile-front-end.sh
@@ -72,7 +72,7 @@
--js Source/WebCore/inspector/front-end/Resource.js \
--js Source/WebCore/inspector/front-end/NetworkManager.js \
--js Source/WebCore/inspector/front-end/UISourceCode.js \
- --module jsmodule_ui:35:jsmodule_common \
+ --module jsmodule_ui:34:jsmodule_common \
--js Source/WebCore/inspector/front-end/Checkbox.js \
--js Source/WebCore/inspector/front-end/Color.js \
--js Source/WebCore/inspector/front-end/ContextMenu.js \
@@ -97,7 +97,6 @@
--js Source/WebCore/inspector/front-end/ShortcutsScreen.js \
--js Source/WebCore/inspector/front-end/ShowMoreDataGridNode.js \
--js Source/WebCore/inspector/front-end/SoftContextMenu.js \
- --js Source/WebCore/inspector/front-end/SourceTokenizer.js \
--js Source/WebCore/inspector/front-end/StatusBarButton.js \
--js Source/WebCore/inspector/front-end/TabbedPane.js \
--js Source/WebCore/inspector/front-end/TextEditorModel.js \
@@ -108,7 +107,7 @@
--js Source/WebCore/inspector/front-end/UIUtils.js \
--js Source/WebCore/inspector/front-end/View.js \
--js Source/WebCore/inspector/front-end/WelcomeView.js \
- --module jsmodule_inspector_views:14:jsmodule_sdk,jsmodule_ui \
+ --module jsmodule_components:18:jsmodule_sdk,jsmodule_ui \
--js Source/WebCore/inspector/front-end/ConsoleMessage.js \
--js Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js \
--js Source/WebCore/inspector/front-end/DOMBreakpointsSidebarPane.js \
@@ -119,15 +118,19 @@
--js Source/WebCore/inspector/front-end/JavaScriptContextManager.js \
--js Source/WebCore/inspector/front-end/ObjectPopoverHelper.js \
--js Source/WebCore/inspector/front-end/ObjectPropertiesSection.js \
+ --js Source/WebCore/inspector/front-end/SourceCSSTokenizer.js \
+ --js Source/WebCore/inspector/front-end/SourceHTMLTokenizer.js \
+ --js Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js \
--js Source/WebCore/inspector/front-end/SourceFrame.js \
+ --js Source/WebCore/inspector/front-end/SourceTokenizer.js \
--js Source/WebCore/inspector/front-end/TimelineAgent.js \
--js Source/WebCore/inspector/front-end/TimelineGrid.js \
--js Source/WebCore/inspector/front-end/TimelineManager.js \
- --module jsmodule_elements:3:jsmodule_inspector_views \
+ --module jsmodule_elements:3:jsmodule_components \
--js Source/WebCore/inspector/front-end/StylesSidebarPane.js \
--js Source/WebCore/inspector/front-end/MetricsSidebarPane.js \
--js Source/WebCore/inspector/front-end/ElementsPanel.js \
- --module jsmodule_network:12:jsmodule_inspector_views \
+ --module jsmodule_network:12:jsmodule_components \
--js Source/WebCore/inspector/front-end/FontView.js \
--js Source/WebCore/inspector/front-end/ImageView.js \
--js Source/WebCore/inspector/front-end/NetworkItemView.js \
@@ -140,14 +143,14 @@
--js Source/WebCore/inspector/front-end/ResourceTimingView.js \
--js Source/WebCore/inspector/front-end/ResourceView.js \
--js Source/WebCore/inspector/front-end/NetworkPanel.js \
- --module jsmodule_resources:6:jsmodule_inspector_views \
+ --module jsmodule_resources:6:jsmodule_components \
--js Source/WebCore/inspector/front-end/ApplicationCacheItemsView.js \
--js Source/WebCore/inspector/front-end/CookieItemsView.js \
--js Source/WebCore/inspector/front-end/DatabaseQueryView.js \
--js Source/WebCore/inspector/front-end/DatabaseTableView.js \
--js Source/WebCore/inspector/front-end/DOMStorageItemsView.js \
--js Source/WebCore/inspector/front-end/ResourcesPanel.js \
- --module jsmodule_scripts:7:jsmodule_inspector_views \
+ --module jsmodule_scripts:7:jsmodule_components \
--js Source/WebCore/inspector/front-end/CallStackSidebarPane.js \
--js Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js \
--js Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js \
@@ -155,15 +158,16 @@
--js Source/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js \
--js Source/WebCore/inspector/front-end/WorkerManager.js \
--js Source/WebCore/inspector/front-end/WorkersSidebarPane.js \
- --module jsmodule_console:2:jsmodule_inspector_views \
+ --module jsmodule_console:2:jsmodule_components \
--js Source/WebCore/inspector/front-end/ConsoleView.js \
- --js Source/WebCore/inspector/front-end/ConsolePanel.js
+ --js Source/WebCore/inspector/front-end/ConsolePanel.js \
+ --module jsmodule_timeline:2:jsmodule_components \
+ --js Source/WebCore/inspector/front-end/TimelineOverviewPane.js \
+ --js Source/WebCore/inspector/front-end/TimelinePanel.js
+
# To be compiled...
-# [Timeline]
-# TimelineOverviewPane
-# TimelinePanel
-#
+#
# [Profiler]
# BottomUpProfileDataGridTree
# DetailedHeapshotGridNodes
@@ -195,9 +199,6 @@
# [Misc]
# inspector
# SettingsScreen
-# SourceCSSTokenizer
-# SourceHTMLTokenizer
-# SourceJavaScriptTokenizer
# TestController
# JavaScriptFormatter
# ScriptFormatterWorker
diff --git a/Source/WebCore/inspector/front-end/SidebarTreeElement.js b/Source/WebCore/inspector/front-end/SidebarTreeElement.js
index 460a823..2113258 100644
--- a/Source/WebCore/inspector/front-end/SidebarTreeElement.js
+++ b/Source/WebCore/inspector/front-end/SidebarTreeElement.js
@@ -70,10 +70,13 @@
/**
* @constructor
* @extends {TreeElement}
+ * @param {string=} subtitle
+ * @param {Object=} representedObject
+ * @param {boolean=} hasChildren
*/
WebInspector.SidebarTreeElement = function(className, title, subtitle, representedObject, hasChildren)
{
- TreeElement.call(this, "", representedObject || {}, hasChildren);
+ TreeElement.call(this, "", representedObject, hasChildren);
if (hasChildren) {
this.disclosureButton = document.createElement("button");
diff --git a/Source/WebCore/inspector/front-end/SourceCSSTokenizer.js b/Source/WebCore/inspector/front-end/SourceCSSTokenizer.js
index d27ab99..72891a0 100644
--- a/Source/WebCore/inspector/front-end/SourceCSSTokenizer.js
+++ b/Source/WebCore/inspector/front-end/SourceCSSTokenizer.js
@@ -131,6 +131,9 @@
return { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
},
+ /**
+ * @param {boolean=} stringEnds
+ */
_stringToken: function(cursor, stringEnds)
{
if (this._isPropertyValue())
@@ -149,6 +152,7 @@
{
var cursorOnEnter = cursor;
var gotoCase = 1;
+ var YYMARKER;
while (1) {
switch (gotoCase)
// Following comment is replaced with generated state machine.
diff --git a/Source/WebCore/inspector/front-end/SourceCSSTokenizer.re2js b/Source/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
index abb51ac..bc9325d 100644
--- a/Source/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
+++ b/Source/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
@@ -130,6 +130,9 @@
return { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
},
+ /**
+ * @param {boolean=} stringEnds
+ */
_stringToken: function(cursor, stringEnds)
{
if (this._isPropertyValue())
@@ -148,6 +151,7 @@
{
var cursorOnEnter = cursor;
var gotoCase = 1;
+ var YYMARKER;
while (1) {
switch (gotoCase)
// Following comment is replaced with generated state machine.
diff --git a/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.js b/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.js
index 5ad332a..b4770cc 100644
--- a/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.js
+++ b/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.js
@@ -125,6 +125,9 @@
this._condition.parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
},
+ /**
+ * @param {boolean=} stringEnds
+ */
_stringToken: function(cursor, stringEnds)
{
if (!this._isExpectingAttributeValue()) {
@@ -205,6 +208,7 @@
var cursorOnEnter = cursor;
var gotoCase = 1;
+ var YYMARKER;
while (1) {
switch (gotoCase)
// Following comment is replaced with generated state machine.
diff --git a/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js b/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
index 5d5550b..a8deedf 100644
--- a/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
+++ b/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
@@ -124,6 +124,9 @@
this._condition.parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
},
+ /**
+ * @param {boolean=} stringEnds
+ */
_stringToken: function(cursor, stringEnds)
{
if (!this._isExpectingAttributeValue()) {
@@ -204,6 +207,7 @@
var cursorOnEnter = cursor;
var gotoCase = 1;
+ var YYMARKER;
while (1) {
switch (gotoCase)
// Following comment is replaced with generated state machine.
diff --git a/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js b/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
index 06cf8f6..ca22c47 100644
--- a/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
+++ b/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
@@ -86,6 +86,7 @@
{
var cursorOnEnter = cursor;
var gotoCase = 1;
+ var YYMARKER;
while (1) {
switch (gotoCase)
// Following comment is replaced with generated state machine.
diff --git a/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js b/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
index 60bf8cf..17d6158 100644
--- a/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
+++ b/Source/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
@@ -85,6 +85,7 @@
{
var cursorOnEnter = cursor;
var gotoCase = 1;
+ var YYMARKER;
while (1) {
switch (gotoCase)
// Following comment is replaced with generated state machine.
diff --git a/Source/WebCore/inspector/front-end/TimelineGrid.js b/Source/WebCore/inspector/front-end/TimelineGrid.js
index 3520fb9..5b7f323 100644
--- a/Source/WebCore/inspector/front-end/TimelineGrid.js
+++ b/Source/WebCore/inspector/front-end/TimelineGrid.js
@@ -58,7 +58,9 @@
return this._itemsGraphsElement;
},
-
+ /**
+ * @param {number=} paddingLeft
+ */
updateDividers: function(force, calculator, paddingLeft)
{
var dividerCount = Math.round(this._dividersElement.offsetWidth / 64);
diff --git a/Source/WebCore/inspector/front-end/TimelineOverviewPane.js b/Source/WebCore/inspector/front-end/TimelineOverviewPane.js
index 800d388..0733fe8 100644
--- a/Source/WebCore/inspector/front-end/TimelineOverviewPane.js
+++ b/Source/WebCore/inspector/front-end/TimelineOverviewPane.js
@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ * @extends {WebInspector.Object}
+ */
WebInspector.TimelineOverviewPane = function(categories)
{
this._categories = categories;
@@ -361,7 +365,7 @@
checkElement.type = "checkbox";
checkElement.className = "timeline-category-checkbox";
checkElement.checked = true;
- checkElement.addEventListener("click", onCheckboxClicked);
+ checkElement.addEventListener("click", onCheckboxClicked, false);
label.appendChild(checkElement);
var typeElement = document.createElement("span");
@@ -377,7 +381,9 @@
WebInspector.TimelineOverviewPane.prototype.__proto__ = WebInspector.Object.prototype;
-
+/**
+ * @constructor
+ */
WebInspector.TimelineOverviewCalculator = function()
{
}
@@ -420,7 +426,9 @@
}
}
-
+/**
+ * @constructor
+ */
WebInspector.TimelineCategoryGraph = function(category, isEven)
{
this._category = category;
@@ -462,6 +470,9 @@
}
}
+/**
+ * @constructor
+ */
WebInspector.TimelinePanel.WindowSelector = function(parent, position, event)
{
this._startPosition = position;
@@ -506,6 +517,9 @@
}
}
+/**
+ * @constructor
+ */
WebInspector.HeapGraph = function() {
this._canvas = document.createElement("canvas");
diff --git a/Source/WebCore/inspector/front-end/TimelinePanel.js b/Source/WebCore/inspector/front-end/TimelinePanel.js
index 36981c2..6a7aa2d 100644
--- a/Source/WebCore/inspector/front-end/TimelinePanel.js
+++ b/Source/WebCore/inspector/front-end/TimelinePanel.js
@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ * @extends {WebInspector.Panel}
+ */
WebInspector.TimelinePanel = function()
{
WebInspector.Panel.call(this, "timeline");
@@ -340,7 +344,7 @@
eventDivider.className += " resources-red-divider";
else if (record.type === recordTypes.TimeStamp) {
eventDivider.className += " resources-orange-divider";
- eventDividerPadding.title = record.data.message;
+ eventDividerPadding.title = record.data["message"];
}
eventDividerPadding.appendChild(eventDivider);
return eventDividerPadding;
@@ -390,18 +394,18 @@
_addRecordToTimeline: function(record)
{
if (record.type === WebInspector.TimelineAgent.RecordType.ResourceSendRequest) {
- var isMainResource = (record.data.requestId === WebInspector.mainResource.requestId);
- if (isMainResource && this._mainRequestId !== record.data.requestId) {
+ var isMainResource = (record.data["requestId"] === WebInspector.mainResource.requestId);
+ if (isMainResource && this._mainRequestId !== record.data["requestId"]) {
// We are loading new main resource -> clear the panel. Check above is necessary since
// there may be several resource loads with main resource marker upon redirects, redirects are reported with
// the original request id.
- this._mainRequestId = record.data.requestId;
+ this._mainRequestId = record.data["requestId"];
this._clearPanel();
}
}
this._model._addRecord(record);
this._innerAddRecordToTimeline(record, this._rootRecord);
- this._scheduleRefresh();
+ this._scheduleRefresh(false);
},
_findParentRecord: function(record)
@@ -411,11 +415,11 @@
if (record.type === recordTypes.ResourceReceiveResponse ||
record.type === recordTypes.ResourceFinish ||
record.type === recordTypes.ResourceReceivedData)
- parentRecord = this._sendRequestRecords[record.data.requestId];
+ parentRecord = this._sendRequestRecords[record.data["requestId"]];
else if (record.type === recordTypes.TimerFire)
- parentRecord = this._timerRecords[record.data.timerId];
+ parentRecord = this._timerRecords[record.data["timerId"]];
else if (record.type === recordTypes.ResourceSendRequest)
- parentRecord = this._scheduledResourceRequests[record.data.url];
+ parentRecord = this._scheduledResourceRequests[record.data["url"]];
return parentRecord;
},
@@ -425,7 +429,7 @@
var recordTypes = WebInspector.TimelineAgent.RecordType;
if (record.type === recordTypes.RegisterAnimationFrameCallback) {
- this._registeredAnimationCallbackRecords[record.data.id] = record;
+ this._registeredAnimationCallbackRecords[record.data["id"]] = record;
return;
}
@@ -444,10 +448,10 @@
var children = record.children;
var scriptDetails;
- if (record.data && record.data.scriptName) {
+ if (record.data && record.data["scriptName"]) {
scriptDetails = {
- scriptName: record.data.scriptName,
- scriptLine: record.data.scriptLine
+ scriptName: record.data["scriptName"],
+ scriptLine: record.data["scriptLine"]
}
};
@@ -455,8 +459,8 @@
var childRecord = children[0];
if (childRecord.type === recordTypes.FunctionCall) {
scriptDetails = {
- scriptName: childRecord.data.scriptName,
- scriptLine: childRecord.data.scriptLine
+ scriptName: childRecord.data["scriptName"],
+ scriptLine: childRecord.data["scriptLine"]
};
children = childRecord.children.concat(children.slice(1));
}
@@ -479,7 +483,7 @@
formattedRecord._calculateAggregatedStats(this.categories);
if (connectedToOldRecord) {
- var record = formattedRecord;
+ record = formattedRecord;
do {
var parent = record.parent;
parent._cpuTime += formattedRecord._cpuTime;
@@ -508,14 +512,14 @@
updateMainViewWidth: function(width)
{
this._containerContentElement.style.left = width + "px";
- this._scheduleRefresh();
+ this._scheduleRefresh(false);
this._overviewPane.updateMainViewWidth(width);
},
onResize: function()
{
this._closeRecordDetails();
- this._scheduleRefresh();
+ this._scheduleRefresh(false);
},
_createRootRecord: function()
@@ -576,7 +580,7 @@
_windowChanged: function()
{
this._closeRecordDetails();
- this._scheduleRefresh();
+ this._scheduleRefresh(false);
},
_scheduleRefresh: function(preserveBoundaries)
@@ -621,6 +625,9 @@
this._calculator.calculateWindow();
},
+ /**
+ * @param {boolean=} parentIsCollapsed
+ */
_addToRecordsWindow: function(record, recordsWindow, parentIsCollapsed)
{
if (!this._calculator._showShortEvents && !record.isLong())
@@ -699,7 +706,7 @@
this._sidebarListElement.appendChild(listRowElement);
}
if (!graphRowElement) {
- graphRowElement = new WebInspector.TimelineRecordGraphRow(this._itemsGraphsElement, scheduleRefreshCallback, rowHeight).element;
+ graphRowElement = new WebInspector.TimelineRecordGraphRow(this._itemsGraphsElement, scheduleRefreshCallback).element;
this._graphRowsElement.appendChild(graphRowElement);
}
@@ -790,6 +797,9 @@
WebInspector.TimelinePanel.prototype.__proto__ = WebInspector.Panel.prototype;
+/**
+ * @constructor
+ */
WebInspector.TimelineCategory = function(name, title, color)
{
this.name = name;
@@ -797,6 +807,9 @@
this.color = color;
}
+/**
+ * @constructor
+ */
WebInspector.TimelineCalculator = function()
{
this.reset();
@@ -861,7 +874,9 @@
}
}
-
+/**
+ * @constructor
+ */
WebInspector.TimelineRecordListRow = function()
{
this.element = document.createElement("div");
@@ -916,6 +931,9 @@
}
}
+/**
+ * @constructor
+ */
WebInspector.TimelineRecordGraphRow = function(graphContainer, scheduleRefresh)
{
this.element = document.createElement("div");
@@ -964,7 +982,7 @@
_onClick: function(event)
{
this._record.collapsed = !this._record.collapsed;
- this._scheduleRefresh();
+ this._scheduleRefresh(false);
},
dispose: function()
@@ -974,6 +992,9 @@
}
}
+/**
+ * @constructor
+ */
WebInspector.TimelinePanel.FormattedRecord = function(record, parentRecord, panel, scriptDetails)
{
this._panel = panel;
@@ -994,19 +1015,19 @@
this.stackTrace = record.stackTrace;
this.totalHeapSize = record.totalHeapSize;
this.usedHeapSize = record.usedHeapSize;
- if (record.data && record.data.url)
- this.url = record.data.url;
+ if (record.data && record.data["url"])
+ this.url = record.data["url"];
if (scriptDetails) {
this.scriptName = scriptDetails.scriptName;
this.scriptLine = scriptDetails.scriptLine;
}
// Make resource receive record last since request was sent; make finish record last since response received.
if (record.type === recordTypes.ResourceSendRequest) {
- panel._sendRequestRecords[record.data.requestId] = this;
+ panel._sendRequestRecords[record.data["requestId"]] = this;
} else if (record.type === recordTypes.ScheduleResourceRequest) {
- panel._scheduledResourceRequests[record.data.url] = this;
+ panel._scheduledResourceRequests[record.data["url"]] = this;
} else if (record.type === recordTypes.ResourceReceiveResponse) {
- var sendRequestRecord = panel._sendRequestRecords[record.data.requestId];
+ var sendRequestRecord = panel._sendRequestRecords[record.data["requestId"]];
if (sendRequestRecord) { // False if we started instrumentation in the middle of request.
this.url = sendRequestRecord.url;
// Now that we have resource in the collection, recalculate details in order to display short url.
@@ -1015,22 +1036,22 @@
sendRequestRecord.parent._refreshDetails();
}
} else if (record.type === recordTypes.ResourceReceivedData || record.type === recordTypes.ResourceFinish) {
- var sendRequestRecord = panel._sendRequestRecords[record.data.requestId];
+ var sendRequestRecord = panel._sendRequestRecords[record.data["requestId"]];
if (sendRequestRecord) // False for main resource.
this.url = sendRequestRecord.url;
} else if (record.type === recordTypes.TimerInstall) {
- this.timeout = record.data.timeout;
- this.singleShot = record.data.singleShot;
- panel._timerRecords[record.data.timerId] = this;
+ this.timeout = record.data["timeout"];
+ this.singleShot = record.data["singleShot"];
+ panel._timerRecords[record.data["timerId"]] = this;
} else if (record.type === recordTypes.TimerFire) {
- var timerInstalledRecord = panel._timerRecords[record.data.timerId];
+ var timerInstalledRecord = panel._timerRecords[record.data["timerId"]];
if (timerInstalledRecord) {
this.callSiteStackTrace = timerInstalledRecord.stackTrace;
this.timeout = timerInstalledRecord.timeout;
this.singleShot = timerInstalledRecord.singleShot;
}
} else if (record.type === recordTypes.FireAnimationFrameEvent) {
- var registerCallbackRecord = panel._registeredAnimationCallbackRecords[record.data.id];
+ var registerCallbackRecord = panel._registeredAnimationCallbackRecords[record.data["id"]];
if (registerCallbackRecord)
this.callSiteStackTrace = registerCallbackRecord.stackTrace;
}
@@ -1081,19 +1102,19 @@
switch (this.type) {
case recordTypes.GCEvent:
- contentHelper._appendTextRow(WebInspector.UIString("Collected"), Number.bytesToString(this.data.usedHeapSizeDelta));
+ contentHelper._appendTextRow(WebInspector.UIString("Collected"), Number.bytesToString(this.data["usedHeapSizeDelta"]));
break;
case recordTypes.TimerInstall:
case recordTypes.TimerFire:
case recordTypes.TimerRemove:
- contentHelper._appendTextRow(WebInspector.UIString("Timer ID"), this.data.timerId);
+ contentHelper._appendTextRow(WebInspector.UIString("Timer ID"), this.data["timerId"]);
if (typeof this.timeout === "number") {
contentHelper._appendTextRow(WebInspector.UIString("Timeout"), Number.secondsToString(this.timeout / 1000));
contentHelper._appendTextRow(WebInspector.UIString("Repeats"), !this.singleShot);
}
break;
case recordTypes.FireAnimationFrameEvent:
- contentHelper._appendTextRow(WebInspector.UIString("Callback ID"), this.data.id);
+ contentHelper._appendTextRow(WebInspector.UIString("Callback ID"), this.data["id"]);
break;
case recordTypes.FunctionCall:
contentHelper._appendLinkRow(WebInspector.UIString("Location"), this.scriptName, this.scriptLine);
@@ -1104,20 +1125,20 @@
case recordTypes.ResourceReceivedData:
case recordTypes.ResourceFinish:
contentHelper._appendLinkRow(WebInspector.UIString("Resource"), this.url);
- if (this.data.requestMethod)
- contentHelper._appendTextRow(WebInspector.UIString("Request Method"), this.data.requestMethod);
- if (typeof this.data.statusCode === "number")
- contentHelper._appendTextRow(WebInspector.UIString("Status Code"), this.data.statusCode);
- if (this.data.mimeType)
- contentHelper._appendTextRow(WebInspector.UIString("MIME Type"), this.data.mimeType);
+ if (this.data["requestMethod"])
+ contentHelper._appendTextRow(WebInspector.UIString("Request Method"), this.data["requestMethod"]);
+ if (typeof this.data["statusCode"] === "number")
+ contentHelper._appendTextRow(WebInspector.UIString("Status Code"), this.data["statusCode"]);
+ if (this.data["mimeType"])
+ contentHelper._appendTextRow(WebInspector.UIString("MIME Type"), this.data["mimeType"]);
break;
case recordTypes.EvaluateScript:
if (this.data && this.url)
- contentHelper._appendLinkRow(WebInspector.UIString("Script"), this.url, this.data.lineNumber);
+ contentHelper._appendLinkRow(WebInspector.UIString("Script"), this.url, this.data["lineNumber"]);
break;
case recordTypes.Paint:
- contentHelper._appendTextRow(WebInspector.UIString("Location"), WebInspector.UIString("(%d, %d)", this.data.x, this.data.y));
- contentHelper._appendTextRow(WebInspector.UIString("Dimensions"), WebInspector.UIString("%d × %d", this.data.width, this.data.height));
+ contentHelper._appendTextRow(WebInspector.UIString("Location"), WebInspector.UIString("(%d, %d)", this.data["x"], this.data["y"]));
+ contentHelper._appendTextRow(WebInspector.UIString("Dimensions"), WebInspector.UIString("%d × %d", this.data["width"], this.data["height"]));
case recordTypes.RecalculateStyles: // We don't want to see default details.
break;
default:
@@ -1150,28 +1171,28 @@
{
switch (this.type) {
case WebInspector.TimelineAgent.RecordType.GCEvent:
- return WebInspector.UIString("%s collected", Number.bytesToString(this.data.usedHeapSizeDelta));
+ return WebInspector.UIString("%s collected", Number.bytesToString(this.data["usedHeapSizeDelta"]));
case WebInspector.TimelineAgent.RecordType.TimerFire:
- return this.scriptName ? this._panel._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data.timerId;
+ return this.scriptName ? this._panel._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data["timerId"];
case WebInspector.TimelineAgent.RecordType.FunctionCall:
return this.scriptName ? this._panel._linkifyLocation(this.scriptName, this.scriptLine, 0) : null;
case WebInspector.TimelineAgent.RecordType.FireAnimationFrameEvent:
- return this.scriptName ? this._panel._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data.id;
+ return this.scriptName ? this._panel._linkifyLocation(this.scriptName, this.scriptLine, 0) : this.data["id"];
case WebInspector.TimelineAgent.RecordType.EventDispatch:
- return this.data ? this.data.type : null;
+ return this.data ? this.data["type"] : null;
case WebInspector.TimelineAgent.RecordType.Paint:
- return this.data.width + "\u2009\u00d7\u2009" + this.data.height;
+ return this.data["width"] + "\u2009\u00d7\u2009" + this.data["height"];
case WebInspector.TimelineAgent.RecordType.TimerInstall:
case WebInspector.TimelineAgent.RecordType.TimerRemove:
- return this.stackTrace ? this._panel._linkifyCallFrame(this.stackTrace[0]) : this.data.timerId;
+ return this.stackTrace ? this._panel._linkifyCallFrame(this.stackTrace[0]) : this.data["timerId"];
case WebInspector.TimelineAgent.RecordType.RegisterAnimationFrameCallback:
case WebInspector.TimelineAgent.RecordType.CancelAnimationFrameCallback:
- return this.stackTrace ? this._panel._linkifyCallFrame(this.stackTrace[0]) : this.data.id;
+ return this.stackTrace ? this._panel._linkifyCallFrame(this.stackTrace[0]) : this.data["id"];
case WebInspector.TimelineAgent.RecordType.ParseHTML:
case WebInspector.TimelineAgent.RecordType.RecalculateStyles:
return this.stackTrace ? this._panel._linkifyCallFrame(this.stackTrace[0]) : null;
case WebInspector.TimelineAgent.RecordType.EvaluateScript:
- return this.url ? this._panel._linkifyLocation(this.url, this.data.lineNumber, 0) : null;
+ return this.url ? this._panel._linkifyLocation(this.url, this.data["lineNumber"], 0) : null;
case WebInspector.TimelineAgent.RecordType.XHRReadyStateChange:
case WebInspector.TimelineAgent.RecordType.XHRLoad:
case WebInspector.TimelineAgent.RecordType.ScheduleResourceRequest:
@@ -1181,7 +1202,7 @@
case WebInspector.TimelineAgent.RecordType.ResourceFinish:
return WebInspector.displayNameForURL(this.url);
case WebInspector.TimelineAgent.RecordType.TimeStamp:
- return this.data.message;
+ return this.data["message"];
default:
return null;
}
@@ -1207,6 +1228,9 @@
}
}
+/**
+ * @constructor
+ */
WebInspector.TimelinePanel.PopupContentHelper = function(title, panel)
{
this._panel = panel;
@@ -1219,6 +1243,9 @@
}
WebInspector.TimelinePanel.PopupContentHelper.prototype = {
+ /**
+ * @param {string=} styleName
+ */
_createCell: function(content, styleName)
{
var text = document.createElement("label");
@@ -1239,6 +1266,9 @@
this._contentTable.appendChild(row);
},
+ /**
+ * @param {string=} titleStyle
+ */
_appendElementRow: function(title, content, titleStyle)
{
var row = document.createElement("tr");
@@ -1253,6 +1283,9 @@
this._contentTable.appendChild(row);
},
+ /**
+ * @param {number=} scriptLine
+ */
_appendLinkRow: function(title, scriptName, scriptLine)
{
var link = this._panel._linkifyLocation(scriptName, scriptLine, 0, "timeline-details");
@@ -1279,6 +1312,9 @@
}
}
+/**
+ * @constructor
+ */
WebInspector.TimelineExpandableElement = function(container)
{
this._element = document.createElement("div");
@@ -1319,6 +1355,9 @@
}
}
+/**
+ * @constructor
+ */
WebInspector.TimelineModel = function(timelinePanel)
{
this._panel = timelinePanel;