Changeset 57150 in webkit
- Timestamp:
- Apr 6, 2010 7:44:25 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r57147 r57150 1 2010-04-06 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: The JS code can be not optimal from memory usage point of view. 6 As example it can generate a lot of temp objects and GC will spend significant time to collect these objects. 7 GCRun event will show us these moments. Also each event can show us how much memory is in use. 8 https://bugs.webkit.org/show_bug.cgi?id=37025 9 10 * inspector/timeline-enum-stability-expected.txt: 11 * inspector/timeline-event-dispatch-expected.txt: 12 * inspector/timeline-layout-expected.txt: 13 * inspector/timeline-mark-timeline-expected.txt: 14 * inspector/timeline-network-resource-expected.txt: 15 * inspector/timeline-paint-expected.txt: 16 * inspector/timeline-parse-html-expected.txt: 17 * inspector/timeline-recalculate-styles-expected.txt: 18 * inspector/timeline-script-tag-1-expected.txt: 19 * inspector/timeline-script-tag-2-expected.txt: 20 * inspector/timeline-test.js: 21 * platform/chromium-win/inspector/timeline-event-dispatch-expected.txt: 22 * platform/chromium-win/inspector/timeline-mark-timeline-expected.txt: 23 * platform/chromium-win/inspector/timeline-network-resource-expected.txt: 24 * platform/chromium-win/inspector/timeline-paint-expected.txt: 25 * platform/chromium-win/inspector/timeline-parse-html-expected.txt: 26 27 2010-04-06 Yury Semikhatsky <yurys@chromium.org> 28 29 Unreviewed. Update Chromium test expectations. 30 31 https://bugs.webkit.org/show_bug.cgi?id=36375 32 33 * platform/chromium-win/fast/workers/worker-script-error-expected.txt: 34 1 35 2010-04-06 Yury Semikhatsky <yurys@chromium.org> 2 36 -
trunk/LayoutTests/inspector/timeline-enum-stability-expected.txt
r56108 r57150 20 20 WebInspector.TimelineAgent.RecordType.FunctionCall : 15 21 21 WebInspector.TimelineAgent.RecordType.ResourceReceiveData : 16 22 WebInspector.TimelineAgent.RecordType.GCEvent : 17 22 23 -
trunk/LayoutTests/inspector/timeline-event-dispatch-expected.txt
r51604 r57150 10 10 + endTime : * DEFINED * 11 11 + type : 0 12 + usedHeapSize : * DEFINED * 13 + totalHeapSize : * DEFINED * 12 14 -
trunk/LayoutTests/inspector/timeline-layout-expected.txt
r53488 r57150 8 8 + endTime : * DEFINED * 9 9 + type : 1 10 + usedHeapSize : * DEFINED * 11 + totalHeapSize : * DEFINED * 10 12 Test data -
trunk/LayoutTests/inspector/timeline-mark-timeline-expected.txt
r50839 r57150 7 7 + } 8 8 + type : 11 9 + usedHeapSize : * DEFINED * 10 + totalHeapSize : * DEFINED * 9 11 -
trunk/LayoutTests/inspector/timeline-network-resource-expected.txt
r56111 r57150 11 11 + } 12 12 + type : 12 13 + usedHeapSize : * DEFINED * 14 + totalHeapSize : * DEFINED * 13 15 14 16 ResourceReceiveResponse Properties: … … 24 26 + endTime : * DEFINED * 25 27 + type : 13 28 + usedHeapSize : * DEFINED * 29 + totalHeapSize : * DEFINED * 26 30 27 31 ResourceFinish Properties: … … 33 37 + } 34 38 + type : 14 39 + usedHeapSize : * DEFINED * 40 + totalHeapSize : * DEFINED * 35 41 Script resource loaded -
trunk/LayoutTests/inspector/timeline-paint-expected.txt
r51196 r57150 12 12 + endTime : * DEFINED * 13 13 + type : 3 14 + usedHeapSize : * DEFINED * 15 + totalHeapSize : * DEFINED * 14 16 -
trunk/LayoutTests/inspector/timeline-parse-html-expected.txt
r53488 r57150 11 11 + endTime : * DEFINED * 12 12 + type : 4 13 + usedHeapSize : * DEFINED * 14 + totalHeapSize : * DEFINED * 13 15 Test data -
trunk/LayoutTests/inspector/timeline-recalculate-styles-expected.txt
r53488 r57150 8 8 + endTime : * DEFINED * 9 9 + type : 2 10 + usedHeapSize : * DEFINED * 11 + totalHeapSize : * DEFINED * 10 12 Test data -
trunk/LayoutTests/inspector/timeline-script-tag-1-expected.txt
r51072 r57150 13 13 + endTime : * DEFINED * 14 14 + type : 10 15 + usedHeapSize : * DEFINED * 16 + totalHeapSize : * DEFINED * 15 17 -
trunk/LayoutTests/inspector/timeline-script-tag-2-expected.txt
r51072 r57150 10 10 + endTime : * DEFINED * 11 11 + type : 10 12 + usedHeapSize : * DEFINED * 13 + totalHeapSize : * DEFINED * 12 14 -
trunk/LayoutTests/inspector/timeline-test.js
r56110 r57150 12 12 callerScriptLine: 1, 13 13 url : 1, 14 usedHeapSize: 1, 15 totalHeapSize: 1, 14 16 mimeType : 1 15 17 }; -
trunk/LayoutTests/platform/chromium-win/inspector/timeline-event-dispatch-expected.txt
r56271 r57150 12 12 + endTime : * DEFINED * 13 13 + type : 0 14 + usedHeapSize : * DEFINED * 15 + totalHeapSize : * DEFINED * 14 16 -
trunk/LayoutTests/platform/chromium-win/inspector/timeline-mark-timeline-expected.txt
r56271 r57150 9 9 + } 10 10 + type : 11 11 + usedHeapSize : * DEFINED * 12 + totalHeapSize : * DEFINED * 11 13 -
trunk/LayoutTests/platform/chromium-win/inspector/timeline-network-resource-expected.txt
r56271 r57150 13 13 + } 14 14 + type : 12 15 + usedHeapSize : * DEFINED * 16 + totalHeapSize : * DEFINED * 15 17 16 18 ResourceReceiveResponse Properties: … … 26 28 + endTime : * DEFINED * 27 29 + type : 13 30 + usedHeapSize : * DEFINED * 31 + totalHeapSize : * DEFINED * 28 32 29 33 ResourceFinish Properties: … … 35 39 + } 36 40 + type : 14 41 + usedHeapSize : * DEFINED * 42 + totalHeapSize : * DEFINED * 37 43 Script resource loaded -
trunk/LayoutTests/platform/chromium-win/inspector/timeline-paint-expected.txt
r56271 r57150 14 14 + endTime : * DEFINED * 15 15 + type : 3 16 + usedHeapSize : * DEFINED * 17 + totalHeapSize : * DEFINED * 16 18 -
trunk/LayoutTests/platform/chromium-win/inspector/timeline-parse-html-expected.txt
r56271 r57150 13 13 + endTime : * DEFINED * 14 14 + type : 4 15 + usedHeapSize : * DEFINED * 16 + totalHeapSize : * DEFINED * 15 17 Test data -
trunk/WebCore/ChangeLog
r57148 r57150 1 2010-04-06 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: The JS code can be not optimal from memory usage point of view. 6 As example it can generate a lot of temp objects and GC will spend significant time to collect these objects. 7 GC event will show us these moments. Also each event can show us how much memory is in use. 8 https://bugs.webkit.org/show_bug.cgi?id=37025 9 10 * WebCore.gypi: 11 * WebCore.pro: 12 * inspector/InspectorTimelineAgent.cpp: 13 (WebCore::InspectorTimelineAgent::InspectorTimelineAgent): 14 (WebCore::InspectorTimelineAgent::pushGCEventRecords): 15 (WebCore::InspectorTimelineAgent::didGC): 16 (WebCore::InspectorTimelineAgent::~InspectorTimelineAgent): 17 (WebCore::InspectorTimelineAgent::didInstallTimer): 18 (WebCore::InspectorTimelineAgent::didRemoveTimer): 19 (WebCore::InspectorTimelineAgent::willSendResourceRequest): 20 (WebCore::InspectorTimelineAgent::didFinishLoadingResource): 21 (WebCore::InspectorTimelineAgent::didMarkTimeline): 22 (WebCore::InspectorTimelineAgent::addRecordToTimeline): 23 (WebCore::InspectorTimelineAgent::setHeapSizeStatistic): 24 (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord): 25 (WebCore::InspectorTimelineAgent::pushCurrentRecord): 26 * inspector/InspectorTimelineAgent.h: 27 (WebCore::): 28 (WebCore::InspectorTimelineAgent::instanceCount): 29 (WebCore::InspectorTimelineAgent::TimelineRecordEntry::TimelineRecordEntry): 30 (WebCore::InspectorTimelineAgent::GCEvent::GCEvent): 31 * inspector/TimelineRecordFactory.cpp: 32 (WebCore::TimelineRecordFactory::createGCEventData): 33 * inspector/TimelineRecordFactory.h: 34 * inspector/front-end/Popover.js: 35 (WebInspector.PopoverHelper.prototype._mouseHover): 36 * inspector/front-end/TimelineAgent.js: 37 * inspector/front-end/TimelinePanel.js: 38 (WebInspector.TimelinePanel.prototype.get _recordStyles): 39 (WebInspector.TimelinePanel.FormattedRecord): 40 (WebInspector.TimelinePanel.FormattedRecord.prototype._generatePopupContent): 41 (WebInspector.TimelinePanel.FormattedRecord.prototype._getRecordDetails): 42 1 43 2010-04-05 Antonio Gomes <tonikitoo@webkit.org> 2 44 -
trunk/WebCore/WebCore.gypi
r57134 r57150 823 823 'bindings/v8/ScriptFunctionCall.cpp', 824 824 'bindings/v8/ScriptFunctionCall.h', 825 'bindings/v8/ScriptGCEvent.cpp', 826 'bindings/v8/ScriptGCEvent.h', 825 827 'bindings/v8/ScriptInstance.cpp', 826 828 'bindings/v8/ScriptInstance.h', … … 1651 1653 'inspector/ScriptBreakpoint.h', 1652 1654 'inspector/ScriptDebugListener.h', 1655 'inspector/ScriptGCEventListener.h', 1653 1656 'inspector/TimelineRecordFactory.cpp', 1654 1657 'inspector/TimelineRecordFactory.h', -
trunk/WebCore/WebCore.pro
r57134 r57150 1084 1084 bindings/js/ScriptEventListener.h \ 1085 1085 bindings/js/ScriptFunctionCall.h \ 1086 bindings/js/ScriptGCEvent.h \ 1086 1087 bindings/js/ScriptObject.h \ 1087 1088 bindings/js/ScriptSourceCode.h \ … … 1430 1431 inspector/InspectorTimelineAgent.h \ 1431 1432 inspector/JavaScriptCallFrame.h \ 1433 inspector/ScriptGCEventListener.h \ 1432 1434 inspector/TimelineRecordFactory.h \ 1433 1435 loader/appcache/ApplicationCacheGroup.h \ -
trunk/WebCore/inspector/InspectorTimelineAgent.cpp
r56108 r57150 51 51 { 52 52 ++s_instanceCount; 53 ScriptGCEvent::addEventListener(this); 53 54 ASSERT(m_frontend); 55 } 56 57 void InspectorTimelineAgent::pushGCEventRecords() 58 { 59 for (GCEvents::iterator i = m_gcEvents.begin(); i != m_gcEvents.end(); ++i) { 60 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, i->startTime); 61 record.set("data", TimelineRecordFactory::createGCEventData(m_frontend, i->collectedBytes)); 62 record.set("endTime", i->endTime); 63 addRecordToTimeline(record, GCEventTimelineRecordType); 64 } 65 m_gcEvents.clear(); 66 } 67 68 void InspectorTimelineAgent::didGC(double startTime, double endTime, size_t collectedBytesCount) 69 { 70 m_gcEvents.append(GCEvent(startTime, endTime, collectedBytesCount)); 54 71 } 55 72 … … 58 75 ASSERT(s_instanceCount); 59 76 --s_instanceCount; 77 ScriptGCEvent::removeEventListener(this); 60 78 } 61 79 … … 127 145 void InspectorTimelineAgent::didInstallTimer(int timerId, int timeout, bool singleShot) 128 146 { 129 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());147 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS()); 130 148 record.set("data", TimelineRecordFactory::createTimerInstallData(m_frontend, timerId, timeout, singleShot)); 131 149 addRecordToTimeline(record, TimerInstallTimelineRecordType); … … 134 152 void InspectorTimelineAgent::didRemoveTimer(int timerId) 135 153 { 136 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());154 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS()); 137 155 record.set("data", TimelineRecordFactory::createGenericTimerData(m_frontend, timerId)); 138 156 addRecordToTimeline(record, TimerRemoveTimelineRecordType); … … 182 200 const ResourceRequest& request) 183 201 { 184 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); 202 pushGCEventRecords(); 203 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS()); 185 204 record.set("data", TimelineRecordFactory::createResourceSendRequestData(m_frontend, identifier, isMainResource, request)); 186 205 record.set("type", ResourceSendRequestTimelineRecordType); 206 setHeapSizeStatistic(record); 187 207 m_frontend->addRecordToTimeline(record); 188 208 } … … 210 230 void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail) 211 231 { 212 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); 232 pushGCEventRecords(); 233 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS()); 213 234 record.set("data", TimelineRecordFactory::createResourceFinishData(m_frontend, identifier, didFail)); 214 235 record.set("type", ResourceFinishTimelineRecordType); 236 setHeapSizeStatistic(record); 215 237 m_frontend->addRecordToTimeline(record); 216 238 } … … 218 240 void InspectorTimelineAgent::didMarkTimeline(const String& message) 219 241 { 220 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds());242 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS()); 221 243 record.set("data", TimelineRecordFactory::createMarkTimelineData(m_frontend, message)); 222 244 addRecordToTimeline(record, MarkTimelineRecordType); … … 236 258 237 259 void InspectorTimelineAgent::addRecordToTimeline(ScriptObject record, TimelineRecordType type) 238 { 260 { 261 if (type != GCEventTimelineRecordType) 262 pushGCEventRecords(); 239 263 record.set("type", type); 264 setHeapSizeStatistic(record); 240 265 if (m_recordStack.isEmpty()) 241 266 m_frontend->addRecordToTimeline(record); … … 244 269 parent.children.set(parent.children.length(), record); 245 270 } 271 } 272 273 void InspectorTimelineAgent::setHeapSizeStatistic(ScriptObject record) 274 { 275 size_t usedHeapSize = 0; 276 size_t totalHeapSize = 0; 277 ScriptGCEvent::getHeapSize(usedHeapSize, totalHeapSize); 278 record.set("usedHeapSize", usedHeapSize); 279 record.set("totalHeapSize", totalHeapSize); 246 280 } 247 281 … … 256 290 entry.record.set("data", entry.data); 257 291 entry.record.set("children", entry.children); 258 entry.record.set("endTime", currentTimeInMilliseconds());292 entry.record.set("endTime", WTF::currentTimeMS()); 259 293 addRecordToTimeline(entry.record, type); 260 294 } 261 295 } 262 296 263 double InspectorTimelineAgent::currentTimeInMilliseconds()264 {265 return currentTime() * 1000.0;266 }267 268 297 void InspectorTimelineAgent::pushCurrentRecord(ScriptObject data, TimelineRecordType type) 269 298 { 270 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, currentTimeInMilliseconds()); 299 pushGCEventRecords(); 300 ScriptObject record = TimelineRecordFactory::createGenericRecord(m_frontend, WTF::currentTimeMS()); 271 301 m_recordStack.append(TimelineRecordEntry(record, data, m_frontend->newScriptArray(), type)); 272 302 } -
trunk/WebCore/inspector/InspectorTimelineAgent.h
r56108 r57150 36 36 #include "Document.h" 37 37 #include "ScriptExecutionContext.h" 38 #include "ScriptGCEvent.h" 39 #include "ScriptGCEventListener.h" 38 40 #include "ScriptObject.h" 39 41 #include "ScriptArray.h" … … 41 43 42 44 namespace WebCore { 43 44 45 46 47 45 class Event; 46 class InspectorFrontend; 47 class IntRect; 48 class ResourceRequest; 49 class ResourceResponse; 48 50 49 // Must be kept in sync with TimelineAgent.js 50 enum TimelineRecordType { 51 EventDispatchTimelineRecordType = 0, 52 LayoutTimelineRecordType = 1, 53 RecalculateStylesTimelineRecordType = 2, 54 PaintTimelineRecordType = 3, 55 ParseHTMLTimelineRecordType = 4, 56 TimerInstallTimelineRecordType = 5, 57 TimerRemoveTimelineRecordType = 6, 58 TimerFireTimelineRecordType = 7, 59 XHRReadyStateChangeRecordType = 8, 60 XHRLoadRecordType = 9, 61 EvaluateScriptTimelineRecordType = 10, 62 MarkTimelineRecordType = 11, 63 ResourceSendRequestTimelineRecordType = 12, 64 ResourceReceiveResponseTimelineRecordType = 13, 65 ResourceFinishTimelineRecordType = 14, 66 FunctionCallTimelineRecordType = 15, 67 ReceiveResourceDataTimelineRecordType = 16, 51 // Must be kept in sync with TimelineAgent.js 52 enum TimelineRecordType { 53 EventDispatchTimelineRecordType = 0, 54 LayoutTimelineRecordType = 1, 55 RecalculateStylesTimelineRecordType = 2, 56 PaintTimelineRecordType = 3, 57 ParseHTMLTimelineRecordType = 4, 58 TimerInstallTimelineRecordType = 5, 59 TimerRemoveTimelineRecordType = 6, 60 TimerFireTimelineRecordType = 7, 61 XHRReadyStateChangeRecordType = 8, 62 XHRLoadRecordType = 9, 63 EvaluateScriptTimelineRecordType = 10, 64 MarkTimelineRecordType = 11, 65 ResourceSendRequestTimelineRecordType = 12, 66 ResourceReceiveResponseTimelineRecordType = 13, 67 ResourceFinishTimelineRecordType = 14, 68 FunctionCallTimelineRecordType = 15, 69 ReceiveResourceDataTimelineRecordType = 16, 70 GCEventTimelineRecordType = 17, 71 }; 72 73 class InspectorTimelineAgent : ScriptGCEventListener, public Noncopyable { 74 public: 75 InspectorTimelineAgent(InspectorFrontend* frontend); 76 ~InspectorTimelineAgent(); 77 78 void reset(); 79 void resetFrontendProxyObject(InspectorFrontend*); 80 81 // Methods called from WebCore. 82 void willCallFunction(const String& scriptName, int scriptLine); 83 void didCallFunction(); 84 85 void willDispatchEvent(const Event&); 86 void didDispatchEvent(); 87 88 void willLayout(); 89 void didLayout(); 90 91 void willRecalculateStyle(); 92 void didRecalculateStyle(); 93 94 void willPaint(const IntRect&); 95 void didPaint(); 96 97 void willWriteHTML(unsigned int length, unsigned int startLine); 98 void didWriteHTML(unsigned int endLine); 99 100 void didInstallTimer(int timerId, int timeout, bool singleShot); 101 void didRemoveTimer(int timerId); 102 void willFireTimer(int timerId); 103 void didFireTimer(); 104 105 void willChangeXHRReadyState(const String&, int); 106 void didChangeXHRReadyState(); 107 void willLoadXHR(const String&); 108 void didLoadXHR(); 109 110 void willEvaluateScript(const String&, int); 111 void didEvaluateScript(); 112 113 void didMarkTimeline(const String&); 114 115 void willSendResourceRequest(unsigned long, bool isMainResource, const ResourceRequest&); 116 void willReceiveResourceResponse(unsigned long, const ResourceResponse&); 117 void didReceiveResourceResponse(); 118 void didFinishLoadingResource(unsigned long, bool didFail); 119 void willReceiveResourceData(unsigned long identifier); 120 void didReceiveResourceData(); 121 122 virtual void didGC(double, double, size_t); 123 124 static int instanceCount() { return s_instanceCount; } 125 static InspectorTimelineAgent* retrieve(ScriptExecutionContext*); 126 127 private: 128 struct TimelineRecordEntry { 129 TimelineRecordEntry(ScriptObject record, ScriptObject data, ScriptArray children, TimelineRecordType type) 130 : record(record), data(data), children(children), type(type) 131 { 132 } 133 ScriptObject record; 134 ScriptObject data; 135 ScriptArray children; 136 TimelineRecordType type; 68 137 }; 138 139 void pushCurrentRecord(ScriptObject, TimelineRecordType); 140 void setHeapSizeStatistic(ScriptObject record); 141 142 void didCompleteCurrentRecord(TimelineRecordType); 69 143 70 class InspectorTimelineAgent : public Noncopyable { 71 public: 72 InspectorTimelineAgent(InspectorFrontend* frontend); 73 ~InspectorTimelineAgent(); 144 void addRecordToTimeline(ScriptObject, TimelineRecordType); 74 145 75 void reset(); 76 void resetFrontendProxyObject(InspectorFrontend*); 146 void pushGCEventRecords(); 77 147 78 // Methods called from WebCore. 79 void willCallFunction(const String& scriptName, int scriptLine); 80 void didCallFunction(); 148 InspectorFrontend* m_frontend; 81 149 82 void willDispatchEvent(const Event&); 83 void didDispatchEvent(); 84 85 void willLayout(); 86 void didLayout(); 87 88 void willRecalculateStyle(); 89 void didRecalculateStyle(); 90 91 void willPaint(const IntRect&); 92 void didPaint(); 93 94 void willWriteHTML(unsigned int length, unsigned int startLine); 95 void didWriteHTML(unsigned int endLine); 96 97 void didInstallTimer(int timerId, int timeout, bool singleShot); 98 void didRemoveTimer(int timerId); 99 void willFireTimer(int timerId); 100 void didFireTimer(); 101 102 void willChangeXHRReadyState(const String&, int); 103 void didChangeXHRReadyState(); 104 void willLoadXHR(const String&); 105 void didLoadXHR(); 106 107 void willEvaluateScript(const String&, int); 108 void didEvaluateScript(); 109 110 void didMarkTimeline(const String&); 111 112 void willSendResourceRequest(unsigned long, bool isMainResource, const ResourceRequest&); 113 void willReceiveResourceResponse(unsigned long, const ResourceResponse&); 114 void didReceiveResourceResponse(); 115 void didFinishLoadingResource(unsigned long, bool didFail); 116 void willReceiveResourceData(unsigned long identifier); 117 void didReceiveResourceData(); 118 119 static int instanceCount() { return s_instanceCount; } 120 static InspectorTimelineAgent* retrieve(ScriptExecutionContext*); 121 122 private: 123 struct TimelineRecordEntry { 124 TimelineRecordEntry(ScriptObject record, ScriptObject data, ScriptArray children, TimelineRecordType type) : record(record), data(data), children(children), type(type) { } 125 ScriptObject record; 126 ScriptObject data; 127 ScriptArray children; 128 TimelineRecordType type; 129 }; 130 131 void pushCurrentRecord(ScriptObject, TimelineRecordType); 132 133 static double currentTimeInMilliseconds(); 134 135 void didCompleteCurrentRecord(TimelineRecordType); 136 137 void addRecordToTimeline(ScriptObject, TimelineRecordType); 138 139 InspectorFrontend* m_frontend; 140 141 Vector< TimelineRecordEntry > m_recordStack; 142 static int s_instanceCount; 150 Vector<TimelineRecordEntry> m_recordStack; 151 static int s_instanceCount; 152 struct GCEvent { 153 GCEvent(double startTime, double endTime, size_t collectedBytes) 154 : startTime(startTime), endTime(endTime), collectedBytes(collectedBytes) 155 { 156 } 157 double startTime; 158 double endTime; 159 size_t collectedBytes; 143 160 }; 161 typedef Vector<GCEvent> GCEvents; 162 GCEvents m_gcEvents; 163 }; 144 164 145 165 inline InspectorTimelineAgent* InspectorTimelineAgent::retrieve(ScriptExecutionContext* context) -
trunk/WebCore/inspector/TimelineRecordFactory.cpp
r56108 r57150 57 57 } 58 58 return record; 59 } 60 61 ScriptObject TimelineRecordFactory::createGCEventData(InspectorFrontend* frontend, const size_t usedHeapSizeDelta) 62 { 63 ScriptObject data = frontend->newScriptObject(); 64 data.set("usedHeapSizeDelta", usedHeapSizeDelta); 65 return data; 59 66 } 60 67 -
trunk/WebCore/inspector/TimelineRecordFactory.h
r56108 r57150 47 47 static ScriptObject createGenericRecord(InspectorFrontend*, double startTime); 48 48 49 static ScriptObject createGCEventData(InspectorFrontend* frontend, const size_t usedHeapSizeDelta); 50 49 51 static ScriptObject createFunctionCallData(InspectorFrontend*, const String& scriptName, int scriptLine); 50 52 -
trunk/WebCore/inspector/front-end/Popover.js
r55614 r57150 222 222 223 223 this._popup = this._showPopup(element); 224 this._popup.contentElement.addEventListener("mousemove", this._killHidePopupTimer.bind(this), true); 224 if (this._popup) 225 this._popup.contentElement.addEventListener("mousemove", this._killHidePopupTimer.bind(this), true); 225 226 }, 226 227 -
trunk/WebCore/inspector/front-end/TimelineAgent.js
r56108 r57150 51 51 ResourceFinish : 14, 52 52 FunctionCall : 15, 53 ResourceReceiveData: 16 53 ResourceReceiveData: 16, 54 GCEvent : 17 54 55 }; 55 56 -
trunk/WebCore/inspector/front-end/TimelinePanel.js
r56997 r57150 152 152 recordStyles[recordTypes.FunctionCall] = { title: WebInspector.UIString("Function Call"), category: this.categories.scripting }; 153 153 recordStyles[recordTypes.ResourceReceiveData] = { title: WebInspector.UIString("Receive Data"), category: this.categories.loading }; 154 recordStyles[recordTypes.GCEvent] = { title: WebInspector.UIString("GC Event"), category: this.categories.scripting }; 154 155 this._recordStylesArray = recordStyles; 155 156 } … … 726 727 this.callerScriptName = record.callerScriptName; 727 728 this.callerScriptLine = record.callerScriptLine; 729 this.totalHeapSize = record.totalHeapSize; 730 this.usedHeapSize = record.usedHeapSize; 728 731 729 732 // Make resource receive record last since request was sent; make finish record last since response received. … … 818 821 const recordTypes = WebInspector.TimelineAgent.RecordType; 819 822 if (this.details) { 820 if (this.type === recordTypes.TimerInstall || 823 if (this.type === recordTypes.GCEvent ) 824 recordContentTable.appendChild(this._createRow(WebInspector.UIString("Collected"), Number.bytesToString(this.data.usedHeapSizeDelta))); 825 else if (this.type === recordTypes.TimerInstall || 821 826 this.type === recordTypes.TimerFire || 822 827 this.type === recordTypes.TimerRemove) { … … 857 862 } 858 863 859 if (this. callerScriptName) {864 if (this.type !== recordTypes.GCEvent && this.callerScriptName) { 860 865 var link = WebInspector.linkifyResourceAsNode(this.callerScriptName, "scripts", this.callerScriptLine); 861 866 recordContentTable.appendChild(this._createLinkRow(WebInspector.UIString("Caller"), link)); 862 867 } 868 if (this.usedHeapSize) { 869 recordContentTable.appendChild(this._createRow(WebInspector.UIString("Used Heap Size"), Number.bytesToString(this.usedHeapSize))); 870 recordContentTable.appendChild(this._createRow(WebInspector.UIString("Total Heap Size"), Number.bytesToString(this.totalHeapSize))); 871 } 863 872 return recordContentTable; 864 873 }, … … 867 876 { 868 877 switch (record.type) { 878 case WebInspector.TimelineAgent.RecordType.GCEvent: 879 return WebInspector.UIString("%s collected", Number.bytesToString(record.data.usedHeapSizeDelta)); 869 880 case WebInspector.TimelineAgent.RecordType.FunctionCall: 870 881 return WebInspector.displayNameForURL(record.data.scriptName) + ":" + record.data.scriptLine;
Note: See TracChangeset
for help on using the changeset viewer.