Changeset 48167 in webkit


Ignore:
Timestamp:
Sep 8, 2009 10:55:32 AM (15 years ago)
Author:
eric@webkit.org
Message:

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:
Location:
trunk/WebCore
Files:
7 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r48165 r48167  
     12009-09-08  Kelly Norton  <knorton@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        WebInspector: Adds a timeline agent to InspectorController that collects
     6        high-level timing data about event dispatch, layout, painting and HTML
     7        parsing and makes it available to Inspector.
     8        https://bugs.webkit.org/show_bug.cgi?id=25503
     9
     10        * WebCore.gypi:
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * dom/Document.cpp:
     13        (WebCore::Document::recalcStyle):
     14        * dom/Document.h:
     15        (WebCore::Document::inspectorTimelineAgent):
     16        * dom/Node.cpp:
     17        (WebCore::Node::dispatchGenericEvent):
     18        * html/HTMLTokenizer.cpp:
     19        (WebCore::HTMLTokenizer::write):
     20        * inspector/DOMDispatchTimelineItem.cpp: Added.
     21        (WebCore::DOMDispatchTimelineItem::DOMDispatchTimelineItem):
     22        (WebCore::DOMDispatchTimelineItem::convertToScriptObject):
     23        * inspector/DOMDispatchTimelineItem.h: Added.
     24        (WebCore::DOMDispatchTimelineItem::~DOMDispatchTimelineItem):
     25        * inspector/InspectorBackend.cpp:
     26        (WebCore::InspectorBackend::enableTimeline):
     27        (WebCore::InspectorBackend::disableTimeline):
     28        (WebCore::InspectorBackend::timelineEnabled):
     29        * inspector/InspectorBackend.h:
     30        * inspector/InspectorBackend.idl:
     31        * inspector/InspectorController.cpp:
     32        (WebCore::InspectorController::setFrontendProxyObject):
     33        (WebCore::InspectorController::close):
     34        (WebCore::InspectorController::resetScriptObjects):
     35        (WebCore::InspectorController::enableTimeline):
     36        (WebCore::InspectorController::disableTimeline):
     37        (WebCore::InspectorController::timelineEnabled):
     38        * inspector/InspectorController.h:
     39        (WebCore::InspectorController::timelineAgent):
     40        * inspector/InspectorFrontend.cpp:
     41        (WebCore::InspectorFrontend::timelineWasEnabled):
     42        (WebCore::InspectorFrontend::timelineWasDisabled):
     43        (WebCore::InspectorFrontend::addItemToTimeline):
     44        * inspector/InspectorFrontend.h:
     45        * inspector/InspectorTimelineAgent.cpp: Added.
     46        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
     47        (WebCore::InspectorTimelineAgent::~InspectorTimelineAgent):
     48        (WebCore::InspectorTimelineAgent::willDispatchDOMEvent):
     49        (WebCore::InspectorTimelineAgent::didDispatchDOMEvent):
     50        (WebCore::InspectorTimelineAgent::willLayout):
     51        (WebCore::InspectorTimelineAgent::didLayout):
     52        (WebCore::InspectorTimelineAgent::willRecalculateStyle):
     53        (WebCore::InspectorTimelineAgent::didRecalculateStyle):
     54        (WebCore::InspectorTimelineAgent::willPaint):
     55        (WebCore::InspectorTimelineAgent::didPaint):
     56        (WebCore::InspectorTimelineAgent::willWriteHTML):
     57        (WebCore::InspectorTimelineAgent::didWriteHTML):
     58        (WebCore::InspectorTimelineAgent::reset):
     59        (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
     60        (WebCore::InspectorTimelineAgent::currentTimeInMilliseconds):
     61        (WebCore::InspectorTimelineAgent::sessionTimeInMilliseconds):
     62        * inspector/InspectorTimelineAgent.h: Added.
     63        * inspector/TimelineItem.cpp: Added.
     64        (WebCore::TimelineItem::TimelineItem):
     65        (WebCore::TimelineItem::addToTimeline):
     66        (WebCore::TimelineItem::convertToScriptObject):
     67        (WebCore::TimelineItem::convertChildrenToScriptArray):
     68        (WebCore::TimelineItem::addChildItem):
     69        * inspector/TimelineItem.h: Added.
     70        (WebCore::):
     71        (WebCore::TimelineItem::~TimelineItem):
     72        (WebCore::TimelineItem::previous):
     73        (WebCore::TimelineItem::releasePrevious):
     74        (WebCore::TimelineItem::setEndTime):
     75        (WebCore::TimelineItem::type):
     76        * inspector/front-end/TimelineAgent.js: Added.
     77        (WebInspector.TimelineAgent):
     78        (WebInspector.addItemToTimeline):
     79        (WebInspector.timelineWasEnabled):
     80        (WebInspector.timelineWasDisabled):
     81        * inspector/front-end/inspector.html:
     82        * page/FrameView.cpp:
     83        (WebCore::FrameView::layout):
     84        (WebCore::FrameView::paintContents):
     85        * page/FrameView.h:
     86        (WebCore::FrameView::inspectorTimelineAgent):
     87        * page/Page.cpp:
     88        (WebCore::Page::inspectorTimelineAgent):
     89        * page/Page.h:
     90
    1912009-09-08  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
    292
  • trunk/WebCore/WebCore.gypi

    r48144 r48167  
    14301430            'inspector/ConsoleMessage.cpp',
    14311431            'inspector/ConsoleMessage.h',
     1432            'inspector/DOMDispatchTimelineItem.cpp',
     1433            'inspector/DOMDispatchTimelineItem.h',
    14321434            'inspector/InspectorBackend.cpp',
    14331435            'inspector/InspectorBackend.h',
     
    14441446            'inspector/InspectorResource.cpp',
    14451447            'inspector/InspectorResource.h',
     1448            'inspector/InspectorTimelineAgent.cpp',
     1449            'inspector/InspectorTimelineAgent.h',
    14461450            'inspector/JavaScriptCallFrame.cpp',
    14471451            'inspector/JavaScriptCallFrame.h',
     
    14531457            'inspector/JavaScriptProfileNode.cpp',
    14541458            'inspector/JavaScriptProfileNode.h',
     1459            'inspector/TimelineItem.cpp',
     1460            'inspector/TimelineItem.h',
    14551461            'loader/appcache/ApplicationCache.cpp',
    14561462            'loader/appcache/ApplicationCache.h',
     
    35073513            'inspector/front-end/SummaryBar.js',
    35083514            'inspector/front-end/TextPrompt.js',
     3515            'inspector/front-end/TimelineAgent.js',
    35093516            'inspector/front-end/TopDownProfileDataGridTree.js',
    35103517            'inspector/front-end/treeoutline.js',
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r48144 r48167  
    3112531125                        </File>
    3112631126                        <File
     31127                                RelativePath="..\inspector\DOMDispatchTimelineItem.cpp"
     31128                                >
     31129                        </File>
     31130                        <File
     31131                                RelativePath="..\inspector\DOMDispatchTimelineItem.h"
     31132                                >
     31133                        </File>
     31134                        <File
    3112731135                                RelativePath="..\inspector\InspectorBackend.cpp"
    3112831136                                >
     
    3118531193                        </File>
    3118631194                        <File
     31195                                RelativePath="..\inspector\InspectorTimelineAgent."
     31196                                >
     31197                        </File>
     31198                        <File
     31199                                RelativePath="..\inspector\InspectorTimelineAgent.h"
     31200                                >
     31201                        </File>
     31202                        <File
    3118731203                                RelativePath="..\inspector\JavaScriptCallFrame.cpp"
    3118831204                                >
     
    3121831234                        <File
    3121931235                                RelativePath="..\inspector\JavaScriptProfileNode.h"
     31236                                >
     31237                        </File>
     31238                        <File
     31239                                RelativePath="..\inspector\TimelineItem.cpp"
     31240                                >
     31241                        </File>
     31242                        <File
     31243                                RelativePath="..\inspector\TimelineItem.h"
    3122031244                                >
    3122131245                        </File>
     
    3142531449                                <File
    3142631450                                        RelativePath="..\inspector\front-end\TextPrompt.js"
     31451                                        >
     31452                                </File>
     31453                                <File
     31454                                        RelativePath="..\inspector\front-end\TimelineAgent.js"
    3142731455                                        >
    3142831456                                </File>
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r48150 r48167  
    11831183                65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
    11841184                72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; };
     1185                7284ADDD0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7284ADDB0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp */; };
     1186                7284ADDE0E6FEB31002EEFBD /* UserStyleSheetLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7284ADDC0E6FEB31002EEFBD /* UserStyleSheetLoader.h */; };
     1187                75092BFE104B80F9003DD168 /* DOMDispatchTimelineItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75092BFC104B80F9003DD168 /* DOMDispatchTimelineItem.cpp */; };
     1188                75092BFF104B80F9003DD168 /* DOMDispatchTimelineItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 75092BFD104B80F9003DD168 /* DOMDispatchTimelineItem.h */; };
     1189                754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */; };
     1190                754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */; };
    11851191                75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */; };
    11861192                75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; };
     
    11901196                75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; };
    11911197                75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
     1198                75A94A03104B74FB0006673C /* TimelineItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75A94A01104B74FB0006673C /* TimelineItem.cpp */; };
     1199                75A94A04104B74FB0006673C /* TimelineItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 75A94A02104B74FB0006673C /* TimelineItem.h */; };
    11921200                7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */; };
    11931201                7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1E88F4101CC384000C4DF5 /* ScriptArray.h */; };
     
    64036411                65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; };
    64046412                72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; };
     6413                7284ADDB0E6FEB31002EEFBD /* UserStyleSheetLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserStyleSheetLoader.cpp; sourceTree = "<group>"; };
     6414                7284ADDC0E6FEB31002EEFBD /* UserStyleSheetLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserStyleSheetLoader.h; sourceTree = "<group>"; };
     6415                75092BFC104B80F9003DD168 /* DOMDispatchTimelineItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMDispatchTimelineItem.cpp; sourceTree = "<group>"; };
     6416                75092BFD104B80F9003DD168 /* DOMDispatchTimelineItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDispatchTimelineItem.h; sourceTree = "<group>"; };
     6417                754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; };
     6418                754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; };
    64056419                75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MessageEvent.cpp; path = dom/MessageEvent.cpp; sourceTree = SOURCE_ROOT; };
    64066420                75793E810D0CE0B3007FC0AC /* MessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MessageEvent.h; path = dom/MessageEvent.h; sourceTree = SOURCE_ROOT; };
     
    64116425                75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; };
    64126426                75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; };
     6427                75A94A01104B74FB0006673C /* TimelineItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineItem.cpp; sourceTree = "<group>"; };
     6428                75A94A02104B74FB0006673C /* TimelineItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineItem.h; sourceTree = "<group>"; };
    64136429                7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArray.cpp; sourceTree = "<group>"; };
    64146430                7A1E88F4101CC384000C4DF5 /* ScriptArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArray.h; sourceTree = "<group>"; };
     
    1021610232                        isa = PBXGroup;
    1021710233                        children = (
     10234                                75092BFC104B80F9003DD168 /* DOMDispatchTimelineItem.cpp */,
     10235                                75092BFD104B80F9003DD168 /* DOMDispatchTimelineItem.h */,
     10236                                75A94A01104B74FB0006673C /* TimelineItem.cpp */,
     10237                                75A94A02104B74FB0006673C /* TimelineItem.h */,
     10238                                754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */,
     10239                                754133A7102E00E800075D00 /* InspectorTimelineAgent.h */,
    1021810240                                1C81B9590E97330800266E07 /* front-end */,
    1021910241                                41F0618D0F5F069800A07EAC /* ConsoleMessage.cpp */,
     
    1770017722                                0FF5026A102BA9430066F39A /* JSMedia.h in Headers */,
    1770117723                                0FF50272102BA96A0066F39A /* Media.h in Headers */,
     17724                                754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
    1770217725                                49484FC2102CF23C00187DD3 /* CanvasGradient.h in Headers */,
    1770317726                                49484FC5102CF23C00187DD3 /* CanvasPattern.h in Headers */,
     
    1774017763                                51ABAE1B103C18FF008C5260 /* SocketStreamError.h in Headers */,
    1774117764                                51ABAE1E103C1913008C5260 /* SocketStreamHandle.h in Headers */,
     17765                                75A94A04104B74FB0006673C /* TimelineItem.h in Headers */,
     17766                                75092BFF104B80F9003DD168 /* DOMDispatchTimelineItem.h in Headers */,
    1774217767                                49EECDE010503C2400099FAB /* CanvasArray.h in Headers */,
    1774317768                                49EECDE310503C2400099FAB /* CanvasArrayBuffer.h in Headers */,
     
    1982519850                                0FF50269102BA9430066F39A /* JSMedia.cpp in Sources */,
    1982619851                                0FF50271102BA96A0066F39A /* Media.cpp in Sources */,
     19852                                754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */,
    1982719853                                49484FC1102CF23C00187DD3 /* CanvasGradient.cpp in Sources */,
    1982819854                                49484FC4102CF23C00187DD3 /* CanvasPattern.cpp in Sources */,
     
    1986219888                                510D4A36103165EE0049EA54 /* SocketStreamHandleBase.cpp in Sources */,
    1986319889                                51ABAE1F103C1913008C5260 /* SocketStreamHandleCFNet.cpp in Sources */,
     19890                                75A94A03104B74FB0006673C /* TimelineItem.cpp in Sources */,
     19891                                75092BFE104B80F9003DD168 /* DOMDispatchTimelineItem.cpp in Sources */,
    1986419892                                49EECDDF10503C2400099FAB /* CanvasArray.cpp in Sources */,
    1986519893                                49EECDE210503C2400099FAB /* CanvasArrayBuffer.cpp in Sources */,
  • trunk/WebCore/dom/Document.cpp

    r48075 r48167  
    8181#include "ImageLoader.h"
    8282#include "InspectorController.h"
     83#include "InspectorTimelineAgent.h"
    8384#include "KeyboardEvent.h"
    8485#include "Logging.h"
     
    11581159        return; // Guard against re-entrancy. -dwh
    11591160
     1161    InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent();
     1162    if (timelineAgent)
     1163        timelineAgent->willRecalculateStyle();
     1164
    11601165    m_inStyleRecalc = true;
    11611166    suspendPostAttachCallbacks();
     
    12301235        implicitClose();
    12311236    }
     1237
     1238    if (timelineAgent)
     1239        timelineAgent->didRecalculateStyle();
    12321240}
    12331241
  • trunk/WebCore/dom/Document.h

    r48075 r48167  
    3434#include "Color.h"
    3535#include "DocumentMarker.h"
     36#include "Page.h"
    3637#include "ScriptExecutionContext.h"
    3738#include "Timer.h"
     
    7576    class HTMLInputElement;
    7677    class HTMLMapElement;
     78    class InspectorTimelineAgent;
    7779    class IntPoint;
    7880    class JSNode;
     
    8082    class NodeFilter;
    8183    class NodeIterator;
    82     class Page;
    8384    class PlatformMouseEvent;
    8485    class ProcessingInstruction;
     
    375376    Page* page() const; // can be NULL
    376377    Settings* settings() const; // can be NULL
     378    InspectorTimelineAgent* inspectorTimelineAgent() const; // can be NULL
    377379
    378380    PassRefPtr<Range> createRange();
     
    11091111}
    11101112
     1113inline InspectorTimelineAgent* Document::inspectorTimelineAgent() const {
     1114    return page() ? page()->inspectorTimelineAgent() : 0;
     1115}
     1116
    11111117} // namespace WebCore
    11121118
  • trunk/WebCore/dom/Node.cpp

    r48106 r48167  
    5151#include "FrameView.h"
    5252#include "HTMLNames.h"
     53#include "InspectorTimelineAgent.h"
    5354#include "KeyboardEvent.h"
    5455#include "Logging.h"
     
    25492550    ASSERT(!event->type().isNull()); // JavaScript code can create an event with an empty name, but not null.
    25502551
     2552    InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent();
     2553    if (timelineAgent)
     2554        timelineAgent->willDispatchDOMEvent(*event);
     2555
    25512556    // Make a vector of ancestors to send the event to.
    25522557    // If the node is not in a document just send the event to it.
     
    26602665
    26612666doneWithDefault:
     2667    if (timelineAgent)
     2668        timelineAgent->didDispatchDOMEvent();
     2669
    26622670    Document::updateStyleForAllDocuments();
    26632671
  • trunk/WebCore/html/HTMLTokenizer.cpp

    r45947 r48167  
    4343#include "HTMLScriptElement.h"
    4444#include "HTMLViewSourceDocument.h"
     45#include "InspectorTimelineAgent.h"
    4546#include "MappedAttribute.h"
    4647#include "Page.h"
     
    16581659        printf("Beginning write at time %d\n", m_doc->elapsedTime());
    16591660#endif
    1660    
     1661
    16611662    int processedCount = 0;
    16621663    double startTime = currentTime();
    16631664
     1665    InspectorTimelineAgent* timelineAgent = m_doc->inspectorTimelineAgent();
     1666    if (timelineAgent)
     1667        timelineAgent->willWriteHTML();
     1668 
    16641669    Frame* frame = m_doc->frame();
    16651670
     
    17821787        printf("Ending write at time %d\n", m_doc->elapsedTime());
    17831788#endif
    1784    
     1789
     1790    if (timelineAgent)
     1791        timelineAgent->didWriteHTML();
     1792
    17851793    m_inWrite = wasInWrite;
    17861794
  • trunk/WebCore/inspector/InspectorBackend.cpp

    r48046 r48167  
    253253}
    254254
     255void InspectorBackend::enableTimeline(bool always)
     256{
     257    if (m_inspectorController)
     258        m_inspectorController->enableTimeline(always);
     259}
     260
     261void InspectorBackend::disableTimeline(bool always)
     262{
     263    if (m_inspectorController)
     264        m_inspectorController->disableTimeline(always);
     265}
     266
     267bool InspectorBackend::timelineEnabled() const
     268{
     269    if (m_inspectorController)
     270        return m_inspectorController->timelineEnabled();
     271    return false;
     272}
     273
    255274void InspectorBackend::getCookies(long callId)
    256275{
  • trunk/WebCore/inspector/InspectorBackend.h

    r48046 r48167  
    9696    const String& platform() const;
    9797
     98    void enableTimeline(bool always);
     99    void disableTimeline(bool always);
     100    bool timelineEnabled() const;
     101
    98102    void getCookies(long callId);
    99103    void deleteCookie(const String& cookieName);
  • trunk/WebCore/inspector/InspectorBackend.idl

    r48046 r48167  
    6161        DOMString hiddenPanels();
    6262        DOMString platform();
     63        void enableTimeline(in boolean always);
     64        void disableTimeline(in boolean always);
     65        boolean timelineEnabled();
    6366        [ImplementationFunction=moveWindowBy] void moveByUnrestricted(in float x, in float y);
    6467        void setAttachedWindowHeight(in unsigned long height);
  • trunk/WebCore/inspector/InspectorController.cpp

    r48146 r48167  
    5555#include "InspectorDOMAgent.h"
    5656#include "InspectorDOMStorageResource.h"
     57#include "InspectorTimelineAgent.h"
    5758#include "InspectorResource.h"
    5859#include "JavaScriptProfile.h"
     
    107108static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
    108109static const char* const lastActivePanelSettingName = "lastActivePanel";
     110static const char* const timelineEnabledSettingName = "timelineEnabled";
    109111
    110112static const unsigned defaultAttachedHeight = 300;
     
    545547    m_frontend.set(new InspectorFrontend(this, scriptState, webInspectorObj));
    546548    m_domAgent = new InspectorDOMAgent(m_frontend.get());
     549
     550    Setting timelineEnabled = setting(timelineEnabledSettingName);
     551    if (timelineEnabled.type() == Setting::BooleanType && timelineEnabled.booleanValue())
     552        m_timelineAgent = new InspectorTimelineAgent(m_frontend.get());
    547553}
    548554
     
    604610        m_domAgent->setDocument(0);
    605611    m_domAgent = 0;
     612    m_timelineAgent = 0;
    606613    m_scriptState = 0;
    607614}
     
    678685        (*it)->unbind();
    679686#endif
     687
     688    if (m_timelineAgent)
     689        m_timelineAgent->reset();
    680690
    681691    m_frontend->reset();
     
    10241034}
    10251035
     1036void InspectorController::enableTimeline(bool always)
     1037{
     1038    if (!enabled())
     1039        return;
     1040
     1041    if (always)
     1042        setSetting(timelineEnabledSettingName, Setting(true));
     1043
     1044    if (m_timelineAgent.get())
     1045        return;
     1046
     1047    m_timelineAgent = new InspectorTimelineAgent(m_frontend.get());
     1048    if (m_frontend)
     1049        m_frontend->timelineWasEnabled();
     1050}
     1051
     1052void InspectorController::disableTimeline(bool always)
     1053{
     1054    if (!enabled())
     1055        return;
     1056
     1057    if (always)
     1058        setSetting(timelineEnabledSettingName, Setting(false));
     1059
     1060    if (!m_timelineAgent.get())
     1061        return;
     1062
     1063    m_timelineAgent.set(0);
     1064    if (m_frontend)
     1065        m_frontend->timelineWasDisabled();
     1066}
     1067
     1068bool InspectorController::timelineEnabled() const
     1069{
     1070    if (!enabled())
     1071        return false;
     1072
     1073    return m_timelineAgent.get();
     1074}
     1075
    10261076#if ENABLE(DATABASE)
    10271077void InspectorController::didOpenDatabase(Database* database, const String& domain, const String& name, const String& version)
  • trunk/WebCore/inspector/InspectorController.h

    r47862 r48167  
    6464class InspectorDOMAgent;
    6565class InspectorFrontend;
     66class InspectorTimelineAgent;
    6667class JavaScriptCallFrame;
    6768class KURL;
     
    222223    void ensureResourceTrackingSettingsLoaded();
    223224
     225    void enableTimeline(bool always = false);
     226    void disableTimeline(bool always = false);
     227    bool timelineEnabled() const;
     228    InspectorTimelineAgent* timelineAgent() { return m_timelineAgent.get(); }
     229
    224230#if ENABLE(DATABASE)
    225231    void didOpenDatabase(Database*, const String& domain, const String& name, const String& version);
     
    318324    OwnPtr<InspectorFrontend> m_frontend;
    319325    RefPtr<InspectorDOMAgent> m_domAgent;
     326    OwnPtr<InspectorTimelineAgent> m_timelineAgent;
    320327    ScriptObject m_injectedScriptObj;
    321328    Page* m_page;
  • trunk/WebCore/inspector/InspectorFrontend.cpp

    r48046 r48167  
    184184}
    185185
     186void InspectorFrontend::timelineWasEnabled()
     187{
     188    callSimpleFunction("timelineWasEnabled");
     189}
     190
     191void InspectorFrontend::timelineWasDisabled()
     192{
     193    callSimpleFunction("timelineWasDisabled");
     194}
     195
     196void InspectorFrontend::addItemToTimeline(const ScriptObject& itemObj)
     197{
     198    OwnPtr<ScriptFunctionCall> function(newFunctionCall("addItemToTimeline"));
     199    function->appendArgument(itemObj);
     200    function->call();
     201}
     202
    186203#if ENABLE(JAVASCRIPT_DEBUGGER)
    187204void InspectorFrontend::attachDebuggerWhenShown()
  • trunk/WebCore/inspector/InspectorFrontend.h

    r48046 r48167  
    113113        void didApplyDomChange(int callId, bool success);
    114114
     115        void timelineWasEnabled();
     116        void timelineWasDisabled();
     117        void addItemToTimeline(const ScriptObject& itemObj);
     118
    115119        void didGetCookies(int callId, const ScriptArray& cookies, const String& cookiesString);
    116120        void didDispatchOnInjectedScript(int callId, const String& result, bool isException);
  • trunk/WebCore/inspector/front-end/inspector.html

    r48046 r48167  
    9090    <script type="text/javascript" src="InjectedScript.js"></script>
    9191    <script type="text/javascript" src="InjectedScriptAccess.js"></script>
     92    <script type="text/javascript" src="TimelineAgent.js"></script>
    9293</head>
    9394<body class="detached">
  • trunk/WebCore/page/FrameView.cpp

    r48070 r48167  
    4444#include "HTMLFrameSetElement.h"
    4545#include "HTMLNames.h"
     46#include "InspectorTimelineAgent.h"
    4647#include "OverflowEvent.h"
    47 #include "Page.h"
    4848#include "RenderPart.h"
    4949#include "RenderPartObject.h"
     
    493493        return;
    494494
     495    InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent();
     496    if (timelineAgent)
     497        timelineAgent->willLayout();
     498
    495499    if (!allowSubtree && m_layoutRoot) {
    496500        m_layoutRoot->markContainingBlocksForLayout(false);
     
    677681    }
    678682
     683    if (timelineAgent)
     684        timelineAgent->didLayout();
     685
    679686    m_nestedLayoutCount--;
    680687}
     
    14991506    if (!frame())
    15001507        return;
    1501    
     1508
     1509    InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent();
     1510    if (timelineAgent)
     1511        timelineAgent->willPaint();
     1512
    15021513    Document* document = frame()->document();
    15031514
     
    15631574    if (isTopLevelPainter)
    15641575        sCurrentPaintTimeStamp = 0;
     1576
     1577    if (timelineAgent)
     1578        timelineAgent->didPaint();
    15651579}
    15661580
  • trunk/WebCore/page/FrameView.h

    r48064 r48167  
    2626#define FrameView_h
    2727
     28#include "Frame.h"
    2829#include "IntSize.h"
     30#include "Page.h"
    2931#include "RenderLayer.h"
    3032#include "ScrollView.h"
     
    3840class Frame;
    3941class FrameViewPrivate;
     42class InspectorTimelineAgent;
    4043class IntRect;
    4144class Node;
     
    233236    bool updateWidgets();
    234237    void scrollToAnchor();
     238
     239    InspectorTimelineAgent* inspectorTimelineAgent() const;
    235240   
    236241    bool hasCustomScrollbars() const;
     
    310315};
    311316
     317inline InspectorTimelineAgent* FrameView::inspectorTimelineAgent() const
     318{
     319    return m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0;
     320}
     321
    312322} // namespace WebCore
    313323
  • trunk/WebCore/page/Page.cpp

    r48075 r48167  
    4242#include "HistoryItem.h"
    4343#include "InspectorController.h"
     44#include "InspectorTimelineAgent.h"
    4445#include "Logging.h"
    4546#include "Navigator.h"
     
    648649}
    649650
     651InspectorTimelineAgent* Page::inspectorTimelineAgent() const
     652{
     653    return m_inspectorController->timelineAgent();
     654}
     655
    650656} // namespace WebCore
  • trunk/WebCore/page/Page.h

    r47056 r48167  
    5757    class InspectorClient;
    5858    class InspectorController;
     59    class InspectorTimelineAgent;
    5960    class Node;
    6061    class PageGroup;
     
    211212        bool javaScriptURLsAreAllowed() const;
    212213
     214        InspectorTimelineAgent* inspectorTimelineAgent() const;
    213215    private:
    214216        void initGroup();
Note: See TracChangeset for help on using the changeset viewer.