Changeset 122312 in webkit
- Timestamp:
- Jul 11, 2012 1:56:35 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r122308 r122312 1 2012-07-09 Eugene Klyuchnikov <eustas.bug@gmail.com> 2 3 Web Inspector: Forward message loop instrumentation data to frontend. 4 https://bugs.webkit.org/show_bug.cgi?id=89584 5 6 Reviewed by Yury Semikhatsky. 7 8 Transmit collected message loop tasks to inspector frontend. 9 Now "Program" should be a top-level event on browsers that 10 support message loop instrumentation. 11 Frontend was changed so that user will not see any changes. 12 13 * inspector/timeline/timeline-enum-stability-expected.txt: 14 1 15 2012-07-11 Zan Dobersek <zandobersek@gmail.com> 2 16 -
trunk/LayoutTests/inspector/timeline/timeline-enum-stability-expected.txt
r121865 r122312 5 5 { 6 6 Root : "Root" 7 Program : "Program" 7 8 EventDispatch : "EventDispatch" 8 9 BeginFrame : "BeginFrame" -
trunk/Source/WebCore/ChangeLog
r122310 r122312 1 2012-07-09 Eugene Klyuchnikov <eustas.bug@gmail.com> 2 3 Web Inspector: Forward message loop instrumentation data to frontend. 4 https://bugs.webkit.org/show_bug.cgi?id=89584 5 6 Reviewed by Yury Semikhatsky. 7 8 Transmit collected message loop tasks to inspector frontend. 9 Now "Program" should be a top-level event on browsers that 10 support message loop instrumentation. 11 Frontend was changed so that user will not see any changes. 12 13 * inspector/InspectorTimelineAgent.cpp: 14 (TimelineRecordType): 15 Added new event type - "Program" 16 (WebCore::InspectorTimelineAgent::willProcessTask): 17 Begin "Program" event. 18 (WebCore::InspectorTimelineAgent::didProcessTask): 19 Finish "Program" event. 20 (WebCore::InspectorTimelineAgent::setHeapSizeStatistic): 21 Do not add counters to "Program" events. 22 (WebCore): 23 (WebCore::InspectorTimelineAgent::innerSetHeapSizeStatistic): 24 Renamed from "setHeapSizeStatistic" 25 * inspector/InspectorTimelineAgent.h: 26 (InspectorTimelineAgent): 27 * inspector/front-end/MemoryStatistics.js: 28 (WebInspector.MemoryStatistics.prototype._onRecordAdded): 29 Unwraps "Program" events. 30 (WebInspector.MemoryStatistics.prototype._innerRecordAdded): 31 Renamed from "_onRecordAdded" 32 * inspector/front-end/TimelineFrameController.js: 33 (WebInspector.TimelineFrameController.prototype._addRecord): 34 Unwraps "Program" events. 35 (WebInspector.TimelineFrameController.prototype._innerAddRecord): 36 Renamed from "_addRecord" 37 * inspector/front-end/TimelineModel.js: 38 * inspector/front-end/TimelineOverviewPane.js: 39 (WebInspector.TimelineCategoryStrips.prototype.update.appendRecord): 40 Filter out "Program" category. 41 (WebInspector.TimelineCategoryStrips.prototype.update): 42 * inspector/front-end/TimelinePanel.js: 43 (WebInspector.TimelinePanel.prototype._createStatusbarButtons): 44 Filter out "Program" category. 45 (WebInspector.TimelinePanel.prototype._innerAddRecordToTimeline): 46 Unwraps "Program" events. 47 * inspector/front-end/TimelinePresentationModel.js: 48 (WebInspector.TimelinePresentationModel.categories): 49 Added "Program" category. 50 (WebInspector.TimelinePresentationModel.recordStyle): 51 Ditto. 52 (WebInspector.TimelinePresentationModel.prototype.addRecord): 53 Unwraps "Program" events. 54 (WebInspector.TimelinePresentationModel.prototype._addRecord): 55 Renamed from "addRecord" 56 1 57 2012-07-11 Kenichi Ishibashi <bashi@chromium.org> 2 58 -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r122105 r122312 62 62 // Must be kept in sync with WebInspector.TimelineModel.RecordType in TimelineModel.js 63 63 namespace TimelineRecordType { 64 static const char Program[] = "Program"; 65 64 66 static const char EventDispatch[] = "EventDispatch"; 65 67 static const char BeginFrame[] = "BeginFrame"; … … 344 346 recordRaw->setString("frameId", frameId); 345 347 } 346 setHeapSizeStatistic (recordRaw.get());348 setHeapSizeStatistics(recordRaw.get()); 347 349 // FIXME: runtimeCast is a hack. We do it because we can't build TimelineEvent directly now. 348 350 RefPtr<TypeBuilder::Timeline::TimelineEvent> record = TypeBuilder::Timeline::TimelineEvent::runtimeCast(recordRaw.release()); … … 429 431 void InspectorTimelineAgent::willProcessTask() 430 432 { 431 // TODO: Record task processing start time.433 pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Program, false, 0); 432 434 } 433 435 434 436 void InspectorTimelineAgent::didProcessTask() 435 437 { 436 // TODO: Record task processing end time.438 didCompleteCurrentRecord(TimelineRecordType::Program); 437 439 } 438 440 … … 445 447 void InspectorTimelineAgent::innerAddRecordToTimeline(PassRefPtr<InspectorObject> prpRecord, const String& type, const String& frameId) 446 448 { 449 DEFINE_STATIC_LOCAL(String, program, (TimelineRecordType::Program)); 450 447 451 RefPtr<InspectorObject> record(prpRecord); 448 452 record->setString("type", type); 449 453 if (!frameId.isEmpty()) 450 454 record->setString("frameId", frameId); 451 setHeapSizeStatistic(record.get()); 455 if (type != program) 456 setHeapSizeStatistics(record.get()); 457 452 458 if (m_recordStack.isEmpty()) { 453 459 // FIXME: runtimeCast is a hack. We do it because we can't build TimelineEvent directly now. … … 460 466 } 461 467 462 void InspectorTimelineAgent::setHeapSizeStatistic (InspectorObject* record)468 void InspectorTimelineAgent::setHeapSizeStatistics(InspectorObject* record) 463 469 { 464 470 size_t usedHeapSize = 0; -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.h
r121980 r122312 163 163 164 164 void pushCurrentRecord(PassRefPtr<InspectorObject>, const String& type, bool captureCallStack, Frame*, bool hasOrphanDetails = false); 165 void setHeapSizeStatistic (InspectorObject* record);165 void setHeapSizeStatistics(InspectorObject* record); 166 166 167 167 void didCompleteCurrentRecord(const String& type); -
trunk/Source/WebCore/inspector/front-end/MemoryStatistics.js
r121865 r122312 258 258 _onRecordAdded: function(event) 259 259 { 260 var counters = event.data["counters"]; 261 if (!counters) 262 return; 263 this._counters.push({ 264 time: event.data.endTime || event.data.startTime, 265 documentCount: counters["documents"], 266 nodeCount: counters["nodes"], 267 listenerCount: counters["jsEventListeners"] 268 }); 260 var statistics = this._counters; 261 function addStatistics(record) 262 { 263 var counters = record["counters"]; 264 if (!counters) 265 return; 266 statistics.push({ 267 time: record.endTime || record.startTime, 268 documentCount: counters["documents"], 269 nodeCount: counters["nodes"], 270 listenerCount: counters["jsEventListeners"] 271 }); 272 } 273 WebInspector.TimelinePresentationModel.forAllRecords([event.data], null, addStatistics); 269 274 }, 270 275 -
trunk/Source/WebCore/inspector/front-end/TimelineFrameController.js
r121865 r122312 62 62 _addRecord: function(record) 63 63 { 64 var records; 65 if (record.type === WebInspector.TimelineModel.RecordType.Program) 66 records = record["children"] || []; 67 else 68 records = [record]; 69 records.forEach(this._innerAddRecord, this); 70 }, 71 72 _innerAddRecord: function(record) 73 { 64 74 if (record.type === WebInspector.TimelineModel.RecordType.BeginFrame && this._lastFrame) 65 75 this._flushFrame(record); -
trunk/Source/WebCore/inspector/front-end/TimelineModel.js
r121865 r122312 45 45 WebInspector.TimelineModel.RecordType = { 46 46 Root: "Root", 47 Program: "Program", 47 48 EventDispatch: "EventDispatch", 48 49 -
trunk/Source/WebCore/inspector/front-end/TimelineOverviewPane.js
r121865 r122312 886 886 var recordEnd = Math.ceil((WebInspector.TimelineModel.endTimeInSeconds(record) - timeOffset) * scale); 887 887 var category = WebInspector.TimelinePresentationModel.categoryForRecord(record); 888 if (category.overviewStripGroupIndex < 0) 889 return; 888 890 var bar = lastBarByGroup[category.overviewStripGroupIndex]; 889 891 // This bar may be merged with previous -- so just adjust the previous bar. -
trunk/Source/WebCore/inspector/front-end/TimelinePanel.js
r121905 r122312 233 233 for (var categoryName in categories) { 234 234 var category = categories[categoryName]; 235 if (category.overviewStripGroupIndex < 0) 236 continue; 235 237 this.statusBarFilters.appendChild(this._createTimelineCategoryStatusBarCheckbox(category, this._onCategoryCheckboxClicked.bind(this, category))); 236 238 } … … 496 498 _innerAddRecordToTimeline: function(record, parentRecord) 497 499 { 498 var formattedRecord= this._presentationModel.addRecord(record, parentRecord);499 ++this._allRecordsCount;500 var records = this._presentationModel.addRecord(record, parentRecord); 501 this._allRecordsCount += records.length; 500 502 var recordTypes = WebInspector.TimelineModel.RecordType; 501 503 var timeStampRecords = this._timeStampRecords; … … 508 510 hasVisibleRecords |= presentationModel.isVisible(record); 509 511 } 510 var records = [ formattedRecord ];511 512 WebInspector.TimelinePresentationModel.forAllRecords(records, processRecord); 513 514 function isAdoptedRecord(record) 515 { 516 return record.parent !== presentationModel.rootRecord; 517 } 512 518 // Tell caller update is necessary either if we added a visible record or if we re-parented a record. 513 return hasVisibleRecords || formattedRecord.parent !== this._presentationModel.rootRecord;519 return hasVisibleRecords || records.some(isAdoptedRecord); 514 520 }, 515 521 -
trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js
r121906 r122312 48 48 return WebInspector.TimelinePresentationModel._categories; 49 49 WebInspector.TimelinePresentationModel._categories = { 50 program: new WebInspector.TimelineCategory("program", WebInspector.UIString("Program"), -1, "#BBBBBB", "#DDDDDD", "#FFFFFF"), 50 51 loading: new WebInspector.TimelineCategory("loading", WebInspector.UIString("Loading"), 0, "#5A8BCC", "#8EB6E9", "#70A2E3"), 51 52 scripting: new WebInspector.TimelineCategory("scripting", WebInspector.UIString("Scripting"), 1, "#D8AA34", "#F3D07A", "#F1C453"), … … 69 70 var recordStyles = {}; 70 71 recordStyles[recordTypes.Root] = { title: "#root", category: categories["loading"] }; 72 recordStyles[recordTypes.Program] = { title: WebInspector.UIString("Program"), category: categories["program"] }; 71 73 recordStyles[recordTypes.EventDispatch] = { title: WebInspector.UIString("Event"), category: categories["scripting"] }; 72 74 recordStyles[recordTypes.BeginFrame] = { title: WebInspector.UIString("Frame Start"), category: categories["rendering"] }; … … 118 120 } 119 121 120 WebInspector.TimelinePresentationModel.forAllRecords = function(recordsArray, callback) 122 /** 123 * @param {Array} recordsArray 124 * @param {?function(*)} preOrderCallback 125 * @param {function(*)=} postOrderCallback 126 */ 127 WebInspector.TimelinePresentationModel.forAllRecords = function(recordsArray, preOrderCallback, postOrderCallback) 121 128 { 122 129 if (!recordsArray) … … 128 135 if (entry.index < records.length) { 129 136 var record = records[entry.index]; 130 if ( callback(record))137 if (preOrderCallback && preOrderCallback(record)) 131 138 return; 132 139 if (record.children) 133 stack.push({array: record.children, index: 0}); 140 stack.push({array: record.children, index: 0, record: record}); 141 else if (postOrderCallback && postOrderCallback(record)) 142 return; 134 143 ++entry.index; 135 } else 144 } else { 145 if (entry.record && postOrderCallback && postOrderCallback(entry.record)) 146 return; 136 147 stack.pop(); 148 } 137 149 } 138 150 } … … 202 214 addRecord: function(record, parentRecord) 203 215 { 216 if (this._minimumRecordTime === -1 || record.startTime < this._minimumRecordTime) 217 this._minimumRecordTime = WebInspector.TimelineModel.startTimeInSeconds(record); 218 219 var records; 220 if (record.type === WebInspector.TimelineModel.RecordType.Program) 221 records = record.children; 222 else 223 records = [record]; 224 225 var formattedRecords = []; 226 var recordsCount = records.length; 227 for (var i = 0; i < recordsCount; ++i) 228 formattedRecords.push(this._innerAddRecord(records[i], parentRecord)); 229 return formattedRecords; 230 }, 231 232 _innerAddRecord: function(record, parentRecord) 233 { 204 234 var connectedToOldRecord = false; 205 235 var recordTypes = WebInspector.TimelineModel.RecordType; 206 207 if (this._minimumRecordTime === -1 || record.startTime < this._minimumRecordTime)208 this._minimumRecordTime = WebInspector.TimelineModel.startTimeInSeconds(record);209 236 210 237 switch (record.type) { … … 254 281 var childrenCount = children ? children.length : 0; 255 282 for (var i = 0; i < childrenCount; ++i) 256 this. addRecord(children[i], formattedRecord);283 this._innerAddRecord(children[i], formattedRecord); 257 284 258 285 formattedRecord.calculateAggregatedStats(WebInspector.TimelinePresentationModel.categories());
Note: See TracChangeset
for help on using the changeset viewer.