Changeset 146975 in webkit
- Timestamp:
- Mar 27, 2013 2:29:05 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r146973 r146975 1 2013-03-27 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: update Timeline.TimelineEvent definition to include DOM counters and native memory stats 4 https://bugs.webkit.org/show_bug.cgi?id=113376 5 6 Reviewed by Vsevolod Vlasov. 7 8 Added missing fields to Timeline.TimelineEvent type definition in Inspector.json 9 10 * inspector/Inspector.json: 11 * inspector/InspectorTimelineAgent.cpp: 12 (WebCore::InspectorTimelineAgent::innerAddRecordToTimeline): 13 (WebCore::InspectorTimelineAgent::setDOMCounters): 14 Switched InspectorTimelineAgent to the new typed event builders. 15 (WebCore::InspectorTimelineAgent::setNativeHeapStatistics): 16 * inspector/InspectorTimelineAgent.h: 17 (InspectorTimelineAgent): 18 1 19 2013-03-27 Vsevolod Vlasov <vsevik@chromium.org> 2 20 -
trunk/Source/WebCore/inspector/Inspector.json
r146777 r146975 2599 2599 "types": [ 2600 2600 { 2601 "id": "DOMCounters", 2602 "type": "object", 2603 "properties": [ 2604 { "name": "documents", "type": "integer" }, 2605 { "name": "nodes", "type": "integer" }, 2606 { "name": "jsEventListeners", "type": "integer" } 2607 ], 2608 "description": "Current values of DOM counters.", 2609 "hidden": true 2610 }, 2611 { 2601 2612 "id": "TimelineEvent", 2602 2613 "type": "object", … … 2605 2616 { "name": "thread", "type": "string", "optional": true, "description": "If present, identifies the thread that produced the event.", "hidden": true }, 2606 2617 { "name": "data", "type": "object", "description": "Event data." }, 2607 { "name": "children", "type": "array", "optional": true, "items": { "$ref": "TimelineEvent" }, "description": "Nested records." } 2618 { "name": "children", "type": "array", "optional": true, "items": { "$ref": "TimelineEvent" }, "description": "Nested records." }, 2619 { "name": "counters", "$ref": "DOMCounters", "optional": true, "hidden": true, "description": "Current values of DOM counters." }, 2620 { "name": "usedHeapSize", "type": "integer", "optional": true, "hidden": true, "description": "Current size of JS heap." }, 2621 { "name": "nativeHeapStatistics", "type": "object", "optional": true, "hidden": true, "description": "Native heap statistics." } 2608 2622 ], 2609 2623 "description": "Timeline record contains information about the recorded activity." -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r146476 r146975 541 541 void InspectorTimelineAgent::innerAddRecordToTimeline(PassRefPtr<InspectorObject> prpRecord, const String& type) 542 542 { 543 RefPtr< InspectorObject> record(prpRecord);543 RefPtr<TypeBuilder::Timeline::TimelineEvent> record = TypeBuilder::Timeline::TimelineEvent::runtimeCast(prpRecord); 544 544 record->setString("type", type); 545 545 if (type == TimelineRecordType::Program) … … 563 563 } 564 564 565 void InspectorTimelineAgent::setDOMCounters( InspectorObject* record)566 { 567 record->set Number("usedHeapSize",getUsedHeapSize());565 void InspectorTimelineAgent::setDOMCounters(TypeBuilder::Timeline::TimelineEvent* record) 566 { 567 record->setUsedHeapSize(getUsedHeapSize()); 568 568 569 569 if (m_state->getBoolean(TimelineAgentState::includeDomCounters)) { 570 RefPtr<InspectorObject> counters = InspectorObject::create(); 571 counters->setNumber("nodes", (m_inspectorType == PageInspector) ? InspectorCounters::counterValue(InspectorCounters::NodeCounter) : 0); 572 counters->setNumber("documents", (m_inspectorType == PageInspector) ? InspectorCounters::counterValue(InspectorCounters::DocumentCounter) : 0); 573 counters->setNumber("jsEventListeners", ThreadLocalInspectorCounters::current().counterValue(ThreadLocalInspectorCounters::JSEventListenerCounter)); 574 record->setObject("counters", counters.release()); 570 int documentCount = 0; 571 int nodeCount = 0; 572 if (m_inspectorType == PageInspector) { 573 documentCount = InspectorCounters::counterValue(InspectorCounters::DocumentCounter); 574 nodeCount = InspectorCounters::counterValue(InspectorCounters::NodeCounter); 575 } 576 int listenerCount = ThreadLocalInspectorCounters::current().counterValue(ThreadLocalInspectorCounters::JSEventListenerCounter); 577 RefPtr<TypeBuilder::Timeline::DOMCounters> counters = TypeBuilder::Timeline::DOMCounters::create() 578 .setDocuments(documentCount) 579 .setNodes(nodeCount) 580 .setJsEventListeners(listenerCount); 581 record->setCounters(counters.release()); 575 582 } 576 583 } 577 584 578 void InspectorTimelineAgent::setNativeHeapStatistics( InspectorObject* record)585 void InspectorTimelineAgent::setNativeHeapStatistics(TypeBuilder::Timeline::TimelineEvent* record) 579 586 { 580 587 if (!m_memoryAgent) … … 591 598 MemoryUsageSupport::processMemorySizesInBytes(&privateBytes, &sharedBytes); 592 599 stats->setNumber("PrivateBytes", privateBytes); 593 record->set Object("nativeHeapStatistics",stats.release());600 record->setNativeHeapStatistics(stats.release()); 594 601 } 595 602 -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.h
r146476 r146975 215 215 void pushCurrentRecord(PassRefPtr<InspectorObject>, const String& type, bool captureCallStack, Frame*, bool hasLowLevelDetails = false); 216 216 217 void setDOMCounters( InspectorObject* record);218 void setNativeHeapStatistics( InspectorObject* record);217 void setDOMCounters(TypeBuilder::Timeline::TimelineEvent* record); 218 void setNativeHeapStatistics(TypeBuilder::Timeline::TimelineEvent* record); 219 219 void setFrameIdentifier(InspectorObject* record, Frame*); 220 220 void pushGCEventRecords();
Note: See TracChangeset
for help on using the changeset viewer.