Changeset 48167 in webkit
- Timestamp:
- Sep 8, 2009 10:55:32 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r48165 r48167 1 2009-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 1 91 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2 92 -
trunk/WebCore/WebCore.gypi
r48144 r48167 1430 1430 'inspector/ConsoleMessage.cpp', 1431 1431 'inspector/ConsoleMessage.h', 1432 'inspector/DOMDispatchTimelineItem.cpp', 1433 'inspector/DOMDispatchTimelineItem.h', 1432 1434 'inspector/InspectorBackend.cpp', 1433 1435 'inspector/InspectorBackend.h', … … 1444 1446 'inspector/InspectorResource.cpp', 1445 1447 'inspector/InspectorResource.h', 1448 'inspector/InspectorTimelineAgent.cpp', 1449 'inspector/InspectorTimelineAgent.h', 1446 1450 'inspector/JavaScriptCallFrame.cpp', 1447 1451 'inspector/JavaScriptCallFrame.h', … … 1453 1457 'inspector/JavaScriptProfileNode.cpp', 1454 1458 'inspector/JavaScriptProfileNode.h', 1459 'inspector/TimelineItem.cpp', 1460 'inspector/TimelineItem.h', 1455 1461 'loader/appcache/ApplicationCache.cpp', 1456 1462 'loader/appcache/ApplicationCache.h', … … 3507 3513 'inspector/front-end/SummaryBar.js', 3508 3514 'inspector/front-end/TextPrompt.js', 3515 'inspector/front-end/TimelineAgent.js', 3509 3516 'inspector/front-end/TopDownProfileDataGridTree.js', 3510 3517 'inspector/front-end/treeoutline.js', -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r48144 r48167 31125 31125 </File> 31126 31126 <File 31127 RelativePath="..\inspector\DOMDispatchTimelineItem.cpp" 31128 > 31129 </File> 31130 <File 31131 RelativePath="..\inspector\DOMDispatchTimelineItem.h" 31132 > 31133 </File> 31134 <File 31127 31135 RelativePath="..\inspector\InspectorBackend.cpp" 31128 31136 > … … 31185 31193 </File> 31186 31194 <File 31195 RelativePath="..\inspector\InspectorTimelineAgent." 31196 > 31197 </File> 31198 <File 31199 RelativePath="..\inspector\InspectorTimelineAgent.h" 31200 > 31201 </File> 31202 <File 31187 31203 RelativePath="..\inspector\JavaScriptCallFrame.cpp" 31188 31204 > … … 31218 31234 <File 31219 31235 RelativePath="..\inspector\JavaScriptProfileNode.h" 31236 > 31237 </File> 31238 <File 31239 RelativePath="..\inspector\TimelineItem.cpp" 31240 > 31241 </File> 31242 <File 31243 RelativePath="..\inspector\TimelineItem.h" 31220 31244 > 31221 31245 </File> … … 31425 31449 <File 31426 31450 RelativePath="..\inspector\front-end\TextPrompt.js" 31451 > 31452 </File> 31453 <File 31454 RelativePath="..\inspector\front-end\TimelineAgent.js" 31427 31455 > 31428 31456 </File> -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r48150 r48167 1183 1183 65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; }; 1184 1184 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 */; }; 1185 1191 75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */; }; 1186 1192 75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; }; … … 1190 1196 75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; }; 1191 1197 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 */; }; 1192 1200 7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */; }; 1193 1201 7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1E88F4101CC384000C4DF5 /* ScriptArray.h */; }; … … 6403 6411 65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; }; 6404 6412 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>"; }; 6405 6419 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MessageEvent.cpp; path = dom/MessageEvent.cpp; sourceTree = SOURCE_ROOT; }; 6406 6420 75793E810D0CE0B3007FC0AC /* MessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MessageEvent.h; path = dom/MessageEvent.h; sourceTree = SOURCE_ROOT; }; … … 6411 6425 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; }; 6412 6426 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>"; }; 6413 6429 7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArray.cpp; sourceTree = "<group>"; }; 6414 6430 7A1E88F4101CC384000C4DF5 /* ScriptArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArray.h; sourceTree = "<group>"; }; … … 10216 10232 isa = PBXGroup; 10217 10233 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 */, 10218 10240 1C81B9590E97330800266E07 /* front-end */, 10219 10241 41F0618D0F5F069800A07EAC /* ConsoleMessage.cpp */, … … 17700 17722 0FF5026A102BA9430066F39A /* JSMedia.h in Headers */, 17701 17723 0FF50272102BA96A0066F39A /* Media.h in Headers */, 17724 754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */, 17702 17725 49484FC2102CF23C00187DD3 /* CanvasGradient.h in Headers */, 17703 17726 49484FC5102CF23C00187DD3 /* CanvasPattern.h in Headers */, … … 17740 17763 51ABAE1B103C18FF008C5260 /* SocketStreamError.h in Headers */, 17741 17764 51ABAE1E103C1913008C5260 /* SocketStreamHandle.h in Headers */, 17765 75A94A04104B74FB0006673C /* TimelineItem.h in Headers */, 17766 75092BFF104B80F9003DD168 /* DOMDispatchTimelineItem.h in Headers */, 17742 17767 49EECDE010503C2400099FAB /* CanvasArray.h in Headers */, 17743 17768 49EECDE310503C2400099FAB /* CanvasArrayBuffer.h in Headers */, … … 19825 19850 0FF50269102BA9430066F39A /* JSMedia.cpp in Sources */, 19826 19851 0FF50271102BA96A0066F39A /* Media.cpp in Sources */, 19852 754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */, 19827 19853 49484FC1102CF23C00187DD3 /* CanvasGradient.cpp in Sources */, 19828 19854 49484FC4102CF23C00187DD3 /* CanvasPattern.cpp in Sources */, … … 19862 19888 510D4A36103165EE0049EA54 /* SocketStreamHandleBase.cpp in Sources */, 19863 19889 51ABAE1F103C1913008C5260 /* SocketStreamHandleCFNet.cpp in Sources */, 19890 75A94A03104B74FB0006673C /* TimelineItem.cpp in Sources */, 19891 75092BFE104B80F9003DD168 /* DOMDispatchTimelineItem.cpp in Sources */, 19864 19892 49EECDDF10503C2400099FAB /* CanvasArray.cpp in Sources */, 19865 19893 49EECDE210503C2400099FAB /* CanvasArrayBuffer.cpp in Sources */, -
trunk/WebCore/dom/Document.cpp
r48075 r48167 81 81 #include "ImageLoader.h" 82 82 #include "InspectorController.h" 83 #include "InspectorTimelineAgent.h" 83 84 #include "KeyboardEvent.h" 84 85 #include "Logging.h" … … 1158 1159 return; // Guard against re-entrancy. -dwh 1159 1160 1161 InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent(); 1162 if (timelineAgent) 1163 timelineAgent->willRecalculateStyle(); 1164 1160 1165 m_inStyleRecalc = true; 1161 1166 suspendPostAttachCallbacks(); … … 1230 1235 implicitClose(); 1231 1236 } 1237 1238 if (timelineAgent) 1239 timelineAgent->didRecalculateStyle(); 1232 1240 } 1233 1241 -
trunk/WebCore/dom/Document.h
r48075 r48167 34 34 #include "Color.h" 35 35 #include "DocumentMarker.h" 36 #include "Page.h" 36 37 #include "ScriptExecutionContext.h" 37 38 #include "Timer.h" … … 75 76 class HTMLInputElement; 76 77 class HTMLMapElement; 78 class InspectorTimelineAgent; 77 79 class IntPoint; 78 80 class JSNode; … … 80 82 class NodeFilter; 81 83 class NodeIterator; 82 class Page;83 84 class PlatformMouseEvent; 84 85 class ProcessingInstruction; … … 375 376 Page* page() const; // can be NULL 376 377 Settings* settings() const; // can be NULL 378 InspectorTimelineAgent* inspectorTimelineAgent() const; // can be NULL 377 379 378 380 PassRefPtr<Range> createRange(); … … 1109 1111 } 1110 1112 1113 inline InspectorTimelineAgent* Document::inspectorTimelineAgent() const { 1114 return page() ? page()->inspectorTimelineAgent() : 0; 1115 } 1116 1111 1117 } // namespace WebCore 1112 1118 -
trunk/WebCore/dom/Node.cpp
r48106 r48167 51 51 #include "FrameView.h" 52 52 #include "HTMLNames.h" 53 #include "InspectorTimelineAgent.h" 53 54 #include "KeyboardEvent.h" 54 55 #include "Logging.h" … … 2549 2550 ASSERT(!event->type().isNull()); // JavaScript code can create an event with an empty name, but not null. 2550 2551 2552 InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent(); 2553 if (timelineAgent) 2554 timelineAgent->willDispatchDOMEvent(*event); 2555 2551 2556 // Make a vector of ancestors to send the event to. 2552 2557 // If the node is not in a document just send the event to it. … … 2660 2665 2661 2666 doneWithDefault: 2667 if (timelineAgent) 2668 timelineAgent->didDispatchDOMEvent(); 2669 2662 2670 Document::updateStyleForAllDocuments(); 2663 2671 -
trunk/WebCore/html/HTMLTokenizer.cpp
r45947 r48167 43 43 #include "HTMLScriptElement.h" 44 44 #include "HTMLViewSourceDocument.h" 45 #include "InspectorTimelineAgent.h" 45 46 #include "MappedAttribute.h" 46 47 #include "Page.h" … … 1658 1659 printf("Beginning write at time %d\n", m_doc->elapsedTime()); 1659 1660 #endif 1660 1661 1661 1662 int processedCount = 0; 1662 1663 double startTime = currentTime(); 1663 1664 1665 InspectorTimelineAgent* timelineAgent = m_doc->inspectorTimelineAgent(); 1666 if (timelineAgent) 1667 timelineAgent->willWriteHTML(); 1668 1664 1669 Frame* frame = m_doc->frame(); 1665 1670 … … 1782 1787 printf("Ending write at time %d\n", m_doc->elapsedTime()); 1783 1788 #endif 1784 1789 1790 if (timelineAgent) 1791 timelineAgent->didWriteHTML(); 1792 1785 1793 m_inWrite = wasInWrite; 1786 1794 -
trunk/WebCore/inspector/InspectorBackend.cpp
r48046 r48167 253 253 } 254 254 255 void InspectorBackend::enableTimeline(bool always) 256 { 257 if (m_inspectorController) 258 m_inspectorController->enableTimeline(always); 259 } 260 261 void InspectorBackend::disableTimeline(bool always) 262 { 263 if (m_inspectorController) 264 m_inspectorController->disableTimeline(always); 265 } 266 267 bool InspectorBackend::timelineEnabled() const 268 { 269 if (m_inspectorController) 270 return m_inspectorController->timelineEnabled(); 271 return false; 272 } 273 255 274 void InspectorBackend::getCookies(long callId) 256 275 { -
trunk/WebCore/inspector/InspectorBackend.h
r48046 r48167 96 96 const String& platform() const; 97 97 98 void enableTimeline(bool always); 99 void disableTimeline(bool always); 100 bool timelineEnabled() const; 101 98 102 void getCookies(long callId); 99 103 void deleteCookie(const String& cookieName); -
trunk/WebCore/inspector/InspectorBackend.idl
r48046 r48167 61 61 DOMString hiddenPanels(); 62 62 DOMString platform(); 63 void enableTimeline(in boolean always); 64 void disableTimeline(in boolean always); 65 boolean timelineEnabled(); 63 66 [ImplementationFunction=moveWindowBy] void moveByUnrestricted(in float x, in float y); 64 67 void setAttachedWindowHeight(in unsigned long height); -
trunk/WebCore/inspector/InspectorController.cpp
r48146 r48167 55 55 #include "InspectorDOMAgent.h" 56 56 #include "InspectorDOMStorageResource.h" 57 #include "InspectorTimelineAgent.h" 57 58 #include "InspectorResource.h" 58 59 #include "JavaScriptProfile.h" … … 107 108 static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight"; 108 109 static const char* const lastActivePanelSettingName = "lastActivePanel"; 110 static const char* const timelineEnabledSettingName = "timelineEnabled"; 109 111 110 112 static const unsigned defaultAttachedHeight = 300; … … 545 547 m_frontend.set(new InspectorFrontend(this, scriptState, webInspectorObj)); 546 548 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()); 547 553 } 548 554 … … 604 610 m_domAgent->setDocument(0); 605 611 m_domAgent = 0; 612 m_timelineAgent = 0; 606 613 m_scriptState = 0; 607 614 } … … 678 685 (*it)->unbind(); 679 686 #endif 687 688 if (m_timelineAgent) 689 m_timelineAgent->reset(); 680 690 681 691 m_frontend->reset(); … … 1024 1034 } 1025 1035 1036 void 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 1052 void 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 1068 bool InspectorController::timelineEnabled() const 1069 { 1070 if (!enabled()) 1071 return false; 1072 1073 return m_timelineAgent.get(); 1074 } 1075 1026 1076 #if ENABLE(DATABASE) 1027 1077 void InspectorController::didOpenDatabase(Database* database, const String& domain, const String& name, const String& version) -
trunk/WebCore/inspector/InspectorController.h
r47862 r48167 64 64 class InspectorDOMAgent; 65 65 class InspectorFrontend; 66 class InspectorTimelineAgent; 66 67 class JavaScriptCallFrame; 67 68 class KURL; … … 222 223 void ensureResourceTrackingSettingsLoaded(); 223 224 225 void enableTimeline(bool always = false); 226 void disableTimeline(bool always = false); 227 bool timelineEnabled() const; 228 InspectorTimelineAgent* timelineAgent() { return m_timelineAgent.get(); } 229 224 230 #if ENABLE(DATABASE) 225 231 void didOpenDatabase(Database*, const String& domain, const String& name, const String& version); … … 318 324 OwnPtr<InspectorFrontend> m_frontend; 319 325 RefPtr<InspectorDOMAgent> m_domAgent; 326 OwnPtr<InspectorTimelineAgent> m_timelineAgent; 320 327 ScriptObject m_injectedScriptObj; 321 328 Page* m_page; -
trunk/WebCore/inspector/InspectorFrontend.cpp
r48046 r48167 184 184 } 185 185 186 void InspectorFrontend::timelineWasEnabled() 187 { 188 callSimpleFunction("timelineWasEnabled"); 189 } 190 191 void InspectorFrontend::timelineWasDisabled() 192 { 193 callSimpleFunction("timelineWasDisabled"); 194 } 195 196 void InspectorFrontend::addItemToTimeline(const ScriptObject& itemObj) 197 { 198 OwnPtr<ScriptFunctionCall> function(newFunctionCall("addItemToTimeline")); 199 function->appendArgument(itemObj); 200 function->call(); 201 } 202 186 203 #if ENABLE(JAVASCRIPT_DEBUGGER) 187 204 void InspectorFrontend::attachDebuggerWhenShown() -
trunk/WebCore/inspector/InspectorFrontend.h
r48046 r48167 113 113 void didApplyDomChange(int callId, bool success); 114 114 115 void timelineWasEnabled(); 116 void timelineWasDisabled(); 117 void addItemToTimeline(const ScriptObject& itemObj); 118 115 119 void didGetCookies(int callId, const ScriptArray& cookies, const String& cookiesString); 116 120 void didDispatchOnInjectedScript(int callId, const String& result, bool isException); -
trunk/WebCore/inspector/front-end/inspector.html
r48046 r48167 90 90 <script type="text/javascript" src="InjectedScript.js"></script> 91 91 <script type="text/javascript" src="InjectedScriptAccess.js"></script> 92 <script type="text/javascript" src="TimelineAgent.js"></script> 92 93 </head> 93 94 <body class="detached"> -
trunk/WebCore/page/FrameView.cpp
r48070 r48167 44 44 #include "HTMLFrameSetElement.h" 45 45 #include "HTMLNames.h" 46 #include "InspectorTimelineAgent.h" 46 47 #include "OverflowEvent.h" 47 #include "Page.h"48 48 #include "RenderPart.h" 49 49 #include "RenderPartObject.h" … … 493 493 return; 494 494 495 InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent(); 496 if (timelineAgent) 497 timelineAgent->willLayout(); 498 495 499 if (!allowSubtree && m_layoutRoot) { 496 500 m_layoutRoot->markContainingBlocksForLayout(false); … … 677 681 } 678 682 683 if (timelineAgent) 684 timelineAgent->didLayout(); 685 679 686 m_nestedLayoutCount--; 680 687 } … … 1499 1506 if (!frame()) 1500 1507 return; 1501 1508 1509 InspectorTimelineAgent* timelineAgent = inspectorTimelineAgent(); 1510 if (timelineAgent) 1511 timelineAgent->willPaint(); 1512 1502 1513 Document* document = frame()->document(); 1503 1514 … … 1563 1574 if (isTopLevelPainter) 1564 1575 sCurrentPaintTimeStamp = 0; 1576 1577 if (timelineAgent) 1578 timelineAgent->didPaint(); 1565 1579 } 1566 1580 -
trunk/WebCore/page/FrameView.h
r48064 r48167 26 26 #define FrameView_h 27 27 28 #include "Frame.h" 28 29 #include "IntSize.h" 30 #include "Page.h" 29 31 #include "RenderLayer.h" 30 32 #include "ScrollView.h" … … 38 40 class Frame; 39 41 class FrameViewPrivate; 42 class InspectorTimelineAgent; 40 43 class IntRect; 41 44 class Node; … … 233 236 bool updateWidgets(); 234 237 void scrollToAnchor(); 238 239 InspectorTimelineAgent* inspectorTimelineAgent() const; 235 240 236 241 bool hasCustomScrollbars() const; … … 310 315 }; 311 316 317 inline InspectorTimelineAgent* FrameView::inspectorTimelineAgent() const 318 { 319 return m_frame->page() ? m_frame->page()->inspectorTimelineAgent() : 0; 320 } 321 312 322 } // namespace WebCore 313 323 -
trunk/WebCore/page/Page.cpp
r48075 r48167 42 42 #include "HistoryItem.h" 43 43 #include "InspectorController.h" 44 #include "InspectorTimelineAgent.h" 44 45 #include "Logging.h" 45 46 #include "Navigator.h" … … 648 649 } 649 650 651 InspectorTimelineAgent* Page::inspectorTimelineAgent() const 652 { 653 return m_inspectorController->timelineAgent(); 654 } 655 650 656 } // namespace WebCore -
trunk/WebCore/page/Page.h
r47056 r48167 57 57 class InspectorClient; 58 58 class InspectorController; 59 class InspectorTimelineAgent; 59 60 class Node; 60 61 class PageGroup; … … 211 212 bool javaScriptURLsAreAllowed() const; 212 213 214 InspectorTimelineAgent* inspectorTimelineAgent() const; 213 215 private: 214 216 void initGroup();
Note: See TracChangeset
for help on using the changeset viewer.