Commit 80bd7d6d authored by eric@webkit.org's avatar eric@webkit.org

2009-09-08 Kelly Norton <knorton@google.com>

        Reviewed by Eric Seidel.

        WebInspector: Adds a timeline agent to InspectorController that collects
        high-level timing data about event dispatch, layout, painting and HTML
        parsing and makes it available to Inspector.
        https://bugs.webkit.org/show_bug.cgi?id=25503

        * WebCore.gypi:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::recalcStyle):
        * dom/Document.h:
        (WebCore::Document::inspectorTimelineAgent):
        * dom/Node.cpp:
        (WebCore::Node::dispatchGenericEvent):
        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::write):
        * inspector/DOMDispatchTimelineItem.cpp: Added.
        (WebCore::DOMDispatchTimelineItem::DOMDispatchTimelineItem):
        (WebCore::DOMDispatchTimelineItem::convertToScriptObject):
        * inspector/DOMDispatchTimelineItem.h: Added.
        (WebCore::DOMDispatchTimelineItem::~DOMDispatchTimelineItem):
        * inspector/InspectorBackend.cpp:
        (WebCore::InspectorBackend::enableTimeline):
        (WebCore::InspectorBackend::disableTimeline):
        (WebCore::InspectorBackend::timelineEnabled):
        * inspector/InspectorBackend.h:
        * inspector/InspectorBackend.idl:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::setFrontendProxyObject):
        (WebCore::InspectorController::close):
        (WebCore::InspectorController::resetScriptObjects):
        (WebCore::InspectorController::enableTimeline):
        (WebCore::InspectorController::disableTimeline):
        (WebCore::InspectorController::timelineEnabled):
        * inspector/InspectorController.h:
        (WebCore::InspectorController::timelineAgent):
        * inspector/InspectorFrontend.cpp:
        (WebCore::InspectorFrontend::timelineWasEnabled):
        (WebCore::InspectorFrontend::timelineWasDisabled):
        (WebCore::InspectorFrontend::addItemToTimeline):
        * inspector/InspectorFrontend.h:
        * inspector/InspectorTimelineAgent.cpp: Added.
        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
        (WebCore::InspectorTimelineAgent::~InspectorTimelineAgent):
        (WebCore::InspectorTimelineAgent::willDispatchDOMEvent):
        (WebCore::InspectorTimelineAgent::didDispatchDOMEvent):
        (WebCore::InspectorTimelineAgent::willLayout):
        (WebCore::InspectorTimelineAgent::didLayout):
        (WebCore::InspectorTimelineAgent::willRecalculateStyle):
        (WebCore::InspectorTimelineAgent::didRecalculateStyle):
        (WebCore::InspectorTimelineAgent::willPaint):
        (WebCore::InspectorTimelineAgent::didPaint):
        (WebCore::InspectorTimelineAgent::willWriteHTML):
        (WebCore::InspectorTimelineAgent::didWriteHTML):
        (WebCore::InspectorTimelineAgent::reset):
        (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
        (WebCore::InspectorTimelineAgent::currentTimeInMilliseconds):
        (WebCore::InspectorTimelineAgent::sessionTimeInMilliseconds):
        * inspector/InspectorTimelineAgent.h: Added.
        * inspector/TimelineItem.cpp: Added.
        (WebCore::TimelineItem::TimelineItem):
        (WebCore::TimelineItem::addToTimeline):
        (WebCore::TimelineItem::convertToScriptObject):
        (WebCore::TimelineItem::convertChildrenToScriptArray):
        (WebCore::TimelineItem::addChildItem):
        * inspector/TimelineItem.h: Added.
        (WebCore::):
        (WebCore::TimelineItem::~TimelineItem):
        (WebCore::TimelineItem::previous):
        (WebCore::TimelineItem::releasePrevious):
        (WebCore::TimelineItem::setEndTime):
        (WebCore::TimelineItem::type):
        * inspector/front-end/TimelineAgent.js: Added.
        (WebInspector.TimelineAgent):
        (WebInspector.addItemToTimeline):
        (WebInspector.timelineWasEnabled):
        (WebInspector.timelineWasDisabled):
        * inspector/front-end/inspector.html:
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        (WebCore::FrameView::paintContents):
        * page/FrameView.h:
        (WebCore::FrameView::inspectorTimelineAgent):
        * page/Page.cpp:
        (WebCore::Page::inspectorTimelineAgent):
        * page/Page.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 18a00fea
2009-09-08 Kelly Norton <knorton@google.com>
Reviewed by Eric Seidel.
WebInspector: Adds a timeline agent to InspectorController that collects
high-level timing data about event dispatch, layout, painting and HTML
parsing and makes it available to Inspector.
https://bugs.webkit.org/show_bug.cgi?id=25503
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
* dom/Document.h:
(WebCore::Document::inspectorTimelineAgent):
* dom/Node.cpp:
(WebCore::Node::dispatchGenericEvent):
* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::write):
* inspector/DOMDispatchTimelineItem.cpp: Added.
(WebCore::DOMDispatchTimelineItem::DOMDispatchTimelineItem):
(WebCore::DOMDispatchTimelineItem::convertToScriptObject):
* inspector/DOMDispatchTimelineItem.h: Added.
(WebCore::DOMDispatchTimelineItem::~DOMDispatchTimelineItem):
* inspector/InspectorBackend.cpp:
(WebCore::InspectorBackend::enableTimeline):
(WebCore::InspectorBackend::disableTimeline):
(WebCore::InspectorBackend::timelineEnabled):
* inspector/InspectorBackend.h:
* inspector/InspectorBackend.idl:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::setFrontendProxyObject):
(WebCore::InspectorController::close):
(WebCore::InspectorController::resetScriptObjects):
(WebCore::InspectorController::enableTimeline):
(WebCore::InspectorController::disableTimeline):
(WebCore::InspectorController::timelineEnabled):
* inspector/InspectorController.h:
(WebCore::InspectorController::timelineAgent):
* inspector/InspectorFrontend.cpp:
(WebCore::InspectorFrontend::timelineWasEnabled):
(WebCore::InspectorFrontend::timelineWasDisabled):
(WebCore::InspectorFrontend::addItemToTimeline):
* inspector/InspectorFrontend.h:
* inspector/InspectorTimelineAgent.cpp: Added.
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
(WebCore::InspectorTimelineAgent::~InspectorTimelineAgent):
(WebCore::InspectorTimelineAgent::willDispatchDOMEvent):
(WebCore::InspectorTimelineAgent::didDispatchDOMEvent):
(WebCore::InspectorTimelineAgent::willLayout):
(WebCore::InspectorTimelineAgent::didLayout):
(WebCore::InspectorTimelineAgent::willRecalculateStyle):
(WebCore::InspectorTimelineAgent::didRecalculateStyle):
(WebCore::InspectorTimelineAgent::willPaint):
(WebCore::InspectorTimelineAgent::didPaint):
(WebCore::InspectorTimelineAgent::willWriteHTML):
(WebCore::InspectorTimelineAgent::didWriteHTML):
(WebCore::InspectorTimelineAgent::reset):
(WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
(WebCore::InspectorTimelineAgent::currentTimeInMilliseconds):
(WebCore::InspectorTimelineAgent::sessionTimeInMilliseconds):
* inspector/InspectorTimelineAgent.h: Added.
* inspector/TimelineItem.cpp: Added.
(WebCore::TimelineItem::TimelineItem):
(WebCore::TimelineItem::addToTimeline):
(WebCore::TimelineItem::convertToScriptObject):
(WebCore::TimelineItem::convertChildrenToScriptArray):
(WebCore::TimelineItem::addChildItem):
* inspector/TimelineItem.h: Added.
(WebCore::):
(WebCore::TimelineItem::~TimelineItem):
(WebCore::TimelineItem::previous):
(WebCore::TimelineItem::releasePrevious):
(WebCore::TimelineItem::setEndTime):
(WebCore::TimelineItem::type):
* inspector/front-end/TimelineAgent.js: Added.
(WebInspector.TimelineAgent):
(WebInspector.addItemToTimeline):
(WebInspector.timelineWasEnabled):
(WebInspector.timelineWasDisabled):
* inspector/front-end/inspector.html:
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::paintContents):
* page/FrameView.h:
(WebCore::FrameView::inspectorTimelineAgent):
* page/Page.cpp:
(WebCore::Page::inspectorTimelineAgent):
* page/Page.h:
2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Simon Hausmann.
......@@ -1429,6 +1429,8 @@
'inspector/InspectorClient.h',
'inspector/ConsoleMessage.cpp',
'inspector/ConsoleMessage.h',
'inspector/DOMDispatchTimelineItem.cpp',
'inspector/DOMDispatchTimelineItem.h',
'inspector/InspectorBackend.cpp',
'inspector/InspectorBackend.h',
'inspector/InspectorController.cpp',
......@@ -1443,6 +1445,8 @@
'inspector/InspectorFrontend.h',
'inspector/InspectorResource.cpp',
'inspector/InspectorResource.h',
'inspector/InspectorTimelineAgent.cpp',
'inspector/InspectorTimelineAgent.h',
'inspector/JavaScriptCallFrame.cpp',
'inspector/JavaScriptCallFrame.h',
'inspector/JavaScriptDebugListener.h',
......@@ -1452,6 +1456,8 @@
'inspector/JavaScriptProfile.h',
'inspector/JavaScriptProfileNode.cpp',
'inspector/JavaScriptProfileNode.h',
'inspector/TimelineItem.cpp',
'inspector/TimelineItem.h',
'loader/appcache/ApplicationCache.cpp',
'loader/appcache/ApplicationCache.h',
'loader/appcache/ApplicationCacheGroup.cpp',
......@@ -3506,6 +3512,7 @@
'inspector/front-end/StylesSidebarPane.js',
'inspector/front-end/SummaryBar.js',
'inspector/front-end/TextPrompt.js',
'inspector/front-end/TimelineAgent.js',
'inspector/front-end/TopDownProfileDataGridTree.js',
'inspector/front-end/treeoutline.js',
'inspector/front-end/utilities.js',
......
......@@ -31123,6 +31123,14 @@
RelativePath="..\inspector\ConsoleMessage.h"
>
</File>
<File
RelativePath="..\inspector\DOMDispatchTimelineItem.cpp"
>
</File>
<File
RelativePath="..\inspector\DOMDispatchTimelineItem.h"
>
</File>
<File
RelativePath="..\inspector\InspectorBackend.cpp"
>
......@@ -31183,6 +31191,14 @@
RelativePath="..\inspector\InspectorResource.h"
>
</File>
<File
RelativePath="..\inspector\InspectorTimelineAgent."
>
</File>
<File
RelativePath="..\inspector\InspectorTimelineAgent.h"
>
</File>
<File
RelativePath="..\inspector\JavaScriptCallFrame.cpp"
>
......@@ -31219,6 +31235,14 @@
RelativePath="..\inspector\JavaScriptProfileNode.h"
>
</File>
<File
RelativePath="..\inspector\TimelineItem.cpp"
>
</File>
<File
RelativePath="..\inspector\TimelineItem.h"
>
</File>
<Filter
Name="front-end"
>
......@@ -31426,6 +31450,10 @@
RelativePath="..\inspector\front-end\TextPrompt.js"
>
</File>
<File
RelativePath="..\inspector\front-end\TimelineAgent.js"
>
</File>
<File
RelativePath="..\inspector\front-end\TopDownProfileDataGridTree.js"
>
......
......@@ -1182,6 +1182,12 @@
65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */; };
65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; };
7284ADDD0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7284ADDB0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp */; };
7284ADDE0E6FEB31002EEFBD /* UserStyleSheetLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7284ADDC0E6FEB31002EEFBD /* UserStyleSheetLoader.h */; };
75092BFE104B80F9003DD168 /* DOMDispatchTimelineItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75092BFC104B80F9003DD168 /* DOMDispatchTimelineItem.cpp */; };
75092BFF104B80F9003DD168 /* DOMDispatchTimelineItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 75092BFD104B80F9003DD168 /* DOMDispatchTimelineItem.h */; };
754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */; };
754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */; };
75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */; };
75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; };
75793EC80D0CE72D007FC0AC /* JSMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793EC60D0CE72D007FC0AC /* JSMessageEvent.cpp */; };
......@@ -1189,6 +1195,8 @@
75793ED30D0CE85B007FC0AC /* DOMMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */; };
75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; };
75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
75A94A03104B74FB0006673C /* TimelineItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75A94A01104B74FB0006673C /* TimelineItem.cpp */; };
75A94A04104B74FB0006673C /* TimelineItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 75A94A02104B74FB0006673C /* TimelineItem.h */; };
7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */; };
7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1E88F4101CC384000C4DF5 /* ScriptArray.h */; };
7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */; };
......@@ -6402,6 +6410,12 @@
65F80697054D9F86008BF776 /* BlockExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockExceptions.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; };
72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; };
7284ADDB0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserStyleSheetLoader.cpp; sourceTree = "<group>"; };
7284ADDC0E6FEB31002EEFBD /* UserStyleSheetLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserStyleSheetLoader.h; sourceTree = "<group>"; };
75092BFC104B80F9003DD168 /* DOMDispatchTimelineItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMDispatchTimelineItem.cpp; sourceTree = "<group>"; };
75092BFD104B80F9003DD168 /* DOMDispatchTimelineItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDispatchTimelineItem.h; sourceTree = "<group>"; };
754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; };
754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MessageEvent.cpp; path = dom/MessageEvent.cpp; sourceTree = SOURCE_ROOT; };
75793E810D0CE0B3007FC0AC /* MessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MessageEvent.h; path = dom/MessageEvent.h; sourceTree = SOURCE_ROOT; };
75793E820D0CE0B3007FC0AC /* MessageEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = MessageEvent.idl; path = dom/MessageEvent.idl; sourceTree = SOURCE_ROOT; };
......@@ -6410,6 +6424,8 @@
75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEvent.h; sourceTree = "<group>"; };
75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; };
75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; };
75A94A01104B74FB0006673C /* TimelineItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineItem.cpp; sourceTree = "<group>"; };
75A94A02104B74FB0006673C /* TimelineItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineItem.h; sourceTree = "<group>"; };
7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArray.cpp; sourceTree = "<group>"; };
7A1E88F4101CC384000C4DF5 /* ScriptArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArray.h; sourceTree = "<group>"; };
7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDOMAgent.cpp; sourceTree = "<group>"; };
......@@ -10215,6 +10231,12 @@
1C81B94D0E9732D900266E07 /* inspector */ = {
isa = PBXGroup;
children = (
75092BFC104B80F9003DD168 /* DOMDispatchTimelineItem.cpp */,
75092BFD104B80F9003DD168 /* DOMDispatchTimelineItem.h */,
75A94A01104B74FB0006673C /* TimelineItem.cpp */,
75A94A02104B74FB0006673C /* TimelineItem.h */,
754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */,
754133A7102E00E800075D00 /* InspectorTimelineAgent.h */,
1C81B9590E97330800266E07 /* front-end */,
41F0618D0F5F069800A07EAC /* ConsoleMessage.cpp */,
41F0618C0F5F069800A07EAC /* ConsoleMessage.h */,
......@@ -17699,6 +17721,7 @@
0FF50263102BA92C0066F39A /* DOMMediaInternal.h in Headers */,
0FF5026A102BA9430066F39A /* JSMedia.h in Headers */,
0FF50272102BA96A0066F39A /* Media.h in Headers */,
754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
49484FC2102CF23C00187DD3 /* CanvasGradient.h in Headers */,
49484FC5102CF23C00187DD3 /* CanvasPattern.h in Headers */,
49484FC8102CF23C00187DD3 /* CanvasPixelArray.h in Headers */,
......@@ -17739,6 +17762,8 @@
510D4A38103165EE0049EA54 /* SocketStreamHandleClient.h in Headers */,
51ABAE1B103C18FF008C5260 /* SocketStreamError.h in Headers */,
51ABAE1E103C1913008C5260 /* SocketStreamHandle.h in Headers */,
75A94A04104B74FB0006673C /* TimelineItem.h in Headers */,
75092BFF104B80F9003DD168 /* DOMDispatchTimelineItem.h in Headers */,
49EECDE010503C2400099FAB /* CanvasArray.h in Headers */,
49EECDE310503C2400099FAB /* CanvasArrayBuffer.h in Headers */,
49EECDE610503C2400099FAB /* CanvasFloatArray.h in Headers */,
......@@ -19824,6 +19849,7 @@
0FF5025C102BA9010066F39A /* DOMMedia.mm in Sources */,
0FF50269102BA9430066F39A /* JSMedia.cpp in Sources */,
0FF50271102BA96A0066F39A /* Media.cpp in Sources */,
754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
49484FC1102CF23C00187DD3 /* CanvasGradient.cpp in Sources */,
49484FC4102CF23C00187DD3 /* CanvasPattern.cpp in Sources */,
49484FC7102CF23C00187DD3 /* CanvasPixelArray.cpp in Sources */,
......@@ -19861,6 +19887,8 @@
510D4A33103165EE0049EA54 /* SocketStreamErrorBase.cpp in Sources */,
510D4A36103165EE0049EA54 /* SocketStreamHandleBase.cpp in Sources */,
51ABAE1F103C1913008C5260 /* SocketStreamHandleCFNet.cpp in Sources */,
75A94A03104B74FB0006673C /* TimelineItem.cpp in Sources */,
75092BFE104B80F9003DD168 /* DOMDispatchTimelineItem.cpp in Sources */,
49EECDDF10503C2400099FAB /* CanvasArray.cpp in Sources */,
49EECDE210503C2400099FAB /* CanvasArrayBuffer.cpp in Sources */,
49EECDE510503C2400099FAB /* CanvasFloatArray.cpp in Sources */,
......@@ -80,6 +80,7 @@
#include "HitTestResult.h"
#include "ImageLoader.h"
#include "InspectorController.h"
#include "InspectorTimelineAgent.h"
#include "KeyboardEvent.h"
#include "Logging.h"
#include "MappedAttribute.h"
......@@ -1157,6 +1158,10 @@ void Document::recalcStyle(StyleChange change)
if (m_inStyleRecalc)
return; // Guard against re-entrancy. -dwh
InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent();
if (timelineAgent)
timelineAgent->willRecalculateStyle();
m_inStyleRecalc = true;
suspendPostAttachCallbacks();
if (view())
......@@ -1229,6 +1234,9 @@ bail_out:
m_closeAfterStyleRecalc = false;
implicitClose();
}
if (timelineAgent)
timelineAgent->didRecalculateStyle();
}
void Document::updateStyleIfNeeded()
......
......@@ -33,6 +33,7 @@
#include "CollectionType.h"
#include "Color.h"
#include "DocumentMarker.h"
#include "Page.h"
#include "ScriptExecutionContext.h"
#include "Timer.h"
#include <wtf/HashCountedSet.h>
......@@ -74,12 +75,12 @@ namespace WebCore {
class HTMLHeadElement;
class HTMLInputElement;
class HTMLMapElement;
class InspectorTimelineAgent;
class IntPoint;
class JSNode;
class MouseEventWithHitTestResults;
class NodeFilter;
class NodeIterator;
class Page;
class PlatformMouseEvent;
class ProcessingInstruction;
class Range;
......@@ -374,6 +375,7 @@ public:
Frame* frame() const { return m_frame; } // can be NULL
Page* page() const; // can be NULL
Settings* settings() const; // can be NULL
InspectorTimelineAgent* inspectorTimelineAgent() const; // can be NULL
PassRefPtr<Range> createRange();
......@@ -1108,6 +1110,10 @@ inline bool Node::isDocumentNode() const
return this == m_document;
}
inline InspectorTimelineAgent* Document::inspectorTimelineAgent() const {
return page() ? page()->inspectorTimelineAgent() : 0;
}
} // namespace WebCore
#endif // Document_h
......@@ -50,6 +50,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "HTMLNames.h"
#include "InspectorTimelineAgent.h"
#include "KeyboardEvent.h"
#include "Logging.h"
#include "MouseEvent.h"
......@@ -2548,6 +2549,10 @@ bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent)
ASSERT(event->target());
ASSERT(!event->type().isNull()); // JavaScript code can create an event with an empty name, but not null.
InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent();
if (timelineAgent)
timelineAgent->willDispatchDOMEvent(*event);
// Make a vector of ancestors to send the event to.
// If the node is not in a document just send the event to it.
// Be sure to ref all of nodes since event handlers could result in the last reference going away.
......@@ -2659,6 +2664,9 @@ doneDispatching:
}
doneWithDefault:
if (timelineAgent)
timelineAgent->didDispatchDOMEvent();
Document::updateStyleForAllDocuments();
return !event->defaultPrevented();
......
......@@ -42,6 +42,7 @@
#include "HTMLParser.h"
#include "HTMLScriptElement.h"
#include "HTMLViewSourceDocument.h"
#include "InspectorTimelineAgent.h"
#include "MappedAttribute.h"
#include "Page.h"
#include "PreloadScanner.h"
......@@ -1657,10 +1658,14 @@ void HTMLTokenizer::write(const SegmentedString& str, bool appendData)
if (!m_doc->ownerElement())
printf("Beginning write at time %d\n", m_doc->elapsedTime());
#endif
int processedCount = 0;
double startTime = currentTime();
InspectorTimelineAgent* timelineAgent = m_doc->inspectorTimelineAgent();
if (timelineAgent)
timelineAgent->willWriteHTML();
Frame* frame = m_doc->frame();
State state = m_state;
......@@ -1781,7 +1786,10 @@ void HTMLTokenizer::write(const SegmentedString& str, bool appendData)
if (!m_doc->ownerElement())
printf("Ending write at time %d\n", m_doc->elapsedTime());
#endif
if (timelineAgent)
timelineAgent->didWriteHTML();
m_inWrite = wasInWrite;
m_state = state;
......
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "DOMDispatchTimelineItem.h"
#include "Event.h"
#include "InspectorFrontend.h"
namespace WebCore {
DOMDispatchTimelineItem::DOMDispatchTimelineItem(PassOwnPtr<TimelineItem> previous, double startTime, const Event& event)
: TimelineItem(previous, startTime, DOMDispatchTimelineItemType)
, m_eventType(event.type().string())
{
}
ScriptObject DOMDispatchTimelineItem::convertToScriptObject(InspectorFrontend* frontend)
{
ScriptObject selfObj = TimelineItem::convertToScriptObject(frontend);
ScriptObject dataObj = frontend->newScriptObject();
dataObj.set("type", m_eventType);
selfObj.set("data", dataObj);
return selfObj;
}
} // namespace WebCore
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DOMDispatchTimelineItem_h
#define DOMDispatchTimelineItem_h
#include "TimelineItem.h"
#include "PlatformString.h"
namespace WebCore {
class Event;
class InspectorFrontend;
class DOMDispatchTimelineItem : public TimelineItem {
public:
DOMDispatchTimelineItem(PassOwnPtr<TimelineItem> previous, double startTime, const Event&);
virtual ~DOMDispatchTimelineItem() { }
protected:
virtual ScriptObject convertToScriptObject(InspectorFrontend*);
private:
String m_eventType;
};
} // namespace WebCore
#endif // !defined(DOMDispatchTimelineItem_h)
......@@ -252,6 +252,25 @@ const String& InspectorBackend::platform() const
return platform;
}
void InspectorBackend::enableTimeline(bool always)
{
if (m_inspectorController)
m_inspectorController->enableTimeline(always);
}
void InspectorBackend::disableTimeline(bool always)
{
if (m_inspectorController)
m_inspectorController->disableTimeline(always);
}
bool InspectorBackend::timelineEnabled() const
{
if (m_inspectorController)
return m_inspectorController->timelineEnabled();
return false;
}
void InspectorBackend::getCookies(long callId)
{
if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
......
......@@ -95,6 +95,10 @@ public:
const String& platform() const;
void enableTimeline(bool always);
void disableTimeline(bool always);
bool timelineEnabled() const;
void getCookies(long callId);
void deleteCookie(const String& cookieName);
......
......@@ -60,6 +60,9 @@ module core {
DOMString localizedStringsURL();
DOMString hiddenPanels();
DOMString platform();
void enableTimeline(in boolean always);
void disableTimeline(in boolean always);
boolean timelineEnabled();
[ImplementationFunction=moveWindowBy] void moveByUnrestricted(in float x, in float y);
void setAttachedWindowHeight(in unsigned long height);
[Custom] DOMObject wrapCallback(in DOMObject callback);
......
......@@ -54,6 +54,7 @@
#include "InspectorDatabaseResource.h"
#include "InspectorDOMAgent.h"
#include "InspectorDOMStorageResource.h"
#include "InspectorTimelineAgent.h"
#include "InspectorResource.h"
#include "JavaScriptProfile.h"
#include "Page.h"
......@@ -106,6 +107,7 @@ static const char* const debuggerEnabledSettingName = "debuggerEnabled";
static const char* const profilerEnabledSettingName = "profilerEnabled";
static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
static const char* const lastActivePanelSettingName = "lastActivePanel";
static const char* const timelineEnabledSettingName = "timelineEnabled";
static const unsigned defaultAttachedHeight = 300;
static const float minimumAttachedHeight = 250.0f;
......@@ -544,6 +546,10 @@ void InspectorController::setFrontendProxyObject(ScriptState* scriptState, Scrip
m_injectedScriptObj = injectedScriptObj;
m_frontend.set(new InspectorFrontend(this, scriptState, webInspectorObj));
m_domAgent = new InspectorDOMAgent(m_frontend.get());
Setting timelineEnabled = setting(timelineEnabledSettingName);
if (timelineEnabled.type() == Setting::BooleanType && timelineEnabled.booleanValue())
m_timelineAgent = new InspectorTimelineAgent(m_frontend.get());
}
void InspectorController::show()
......@@ -603,6 +609,7 @@ void InspectorController::close()
if (m_domAgent)
m_domAgent->setDocument(0);
m_domAgent = 0;
m_timelineAgent = 0;
m_scriptState = 0;
}
......@@ -678,6 +685,9 @@ void InspectorController::resetScriptObjects()
(*it)->unbind();
#endif
if (m_timelineAgent)
m_timelineAgent->reset();
m_frontend->reset();
}
......@@ -1023,6 +1033,46 @@ void InspectorController::ensureResourceTrackingSettingsLoaded()
m_resourceTrackingEnabled = true;
}
void InspectorController::enableTimeline(bool always)
{
if (!enabled())
return;
if (always)
setSetting(timelineEnabledSettingName, Setting(true));
if (m_timelineAgent.get())
return;
m_timelineAgent = new InspectorTimelineAgent(m_frontend.get());
if (m_frontend)
m_frontend->timelineWasEnabled();
}
void InspectorController::disableTimeline(bool always)
{
if (!enabled())
return;
if (always)
setSetting(timelineEnabledSettingName, Setting(false));
if (!m_timelineAgent.get())
return;
m_timelineAgent.set(0);
if (m_frontend)
m_frontend->timelineWasDisabled();
}