diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/inspector/InspectorTimelineAgent.h')
-rw-r--r-- | src/3rdparty/webkit/WebCore/inspector/InspectorTimelineAgent.h | 70 |
1 files changed, 60 insertions, 10 deletions
diff --git a/src/3rdparty/webkit/WebCore/inspector/InspectorTimelineAgent.h b/src/3rdparty/webkit/WebCore/inspector/InspectorTimelineAgent.h index 4095fed6fa..0401977b8d 100644 --- a/src/3rdparty/webkit/WebCore/inspector/InspectorTimelineAgent.h +++ b/src/3rdparty/webkit/WebCore/inspector/InspectorTimelineAgent.h @@ -31,16 +31,30 @@ #ifndef InspectorTimelineAgent_h #define InspectorTimelineAgent_h +#include "Document.h" +#include "ScriptExecutionContext.h" #include "ScriptObject.h" #include "ScriptArray.h" - -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> +#include <wtf/Vector.h> namespace WebCore { class Event; class InspectorFrontend; - class TimelineItem; + + // Must be kept in sync with TimelineAgent.js + enum TimelineRecordType { + DOMDispatchTimelineRecordType = 0, + LayoutTimelineRecordType = 1, + RecalculateStylesTimelineRecordType = 2, + PaintTimelineRecordType = 3, + ParseHTMLTimelineRecordType = 4, + TimerInstallTimelineRecordType = 5, + TimerRemoveTimelineRecordType = 6, + TimerFireTimelineRecordType = 7, + XHRReadyStateChangeRecordType = 8, + XHRLoadRecordType = 9, + EvaluateScriptTagTimelineRecordType = 10, + }; class InspectorTimelineAgent { public: @@ -48,30 +62,66 @@ namespace WebCore { ~InspectorTimelineAgent(); void reset(); + void resetFrontendProxyObject(InspectorFrontend*); // Methods called from WebCore. void willDispatchDOMEvent(const Event&); void didDispatchDOMEvent(); + void willLayout(); void didLayout(); + void willRecalculateStyle(); void didRecalculateStyle(); + void willPaint(); void didPaint(); - void didWriteHTML(); + void willWriteHTML(); - private: - double sessionTimeInMilliseconds(); + void didWriteHTML(); + + void didInstallTimer(int timerId, int timeout, bool singleShot); + void didRemoveTimer(int timerId); + void willFireTimer(int timerId); + void didFireTimer(); + + void willChangeXHRReadyState(const String&, int); + void didChangeXHRReadyState(); + void willLoadXHR(const String&); + void didLoadXHR(); + void willEvaluateScriptTag(const String&, int); + void didEvaluateScriptTag(); + + static InspectorTimelineAgent* retrieve(ScriptExecutionContext*); + private: + struct TimelineRecordEntry { + TimelineRecordEntry(ScriptObject record, ScriptArray children, TimelineRecordType type) : record(record), children(children), type(type) { } + ScriptObject record; + ScriptArray children; + TimelineRecordType type; + }; + + void pushCurrentRecord(ScriptObject, TimelineRecordType); + static double currentTimeInMilliseconds(); - void didCompleteCurrentRecord(); + void didCompleteCurrentRecord(TimelineRecordType); + + void addRecordToTimeline(ScriptObject, TimelineRecordType); - double m_sessionStartTime; InspectorFrontend* m_frontend; - OwnPtr<TimelineItem> m_currentTimelineItem; + + Vector< TimelineRecordEntry > m_recordStack; }; +inline InspectorTimelineAgent* InspectorTimelineAgent::retrieve(ScriptExecutionContext* context) +{ + if (context->isDocument()) + return static_cast<Document*>(context)->inspectorTimelineAgent(); + return 0; +} + } // namespace WebCore #endif // !defined(InspectorTimelineAgent_h) |