Changeset 83975 in webkit
- Timestamp:
- Apr 15, 2011 8:15:42 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r83952 r83975 889 889 inspector/ConsoleMessage.cpp 890 890 inspector/DOMNodeHighlighter.cpp 891 inspector/EventsCollector.cpp 891 892 inspector/InjectedScript.cpp 892 893 inspector/InjectedScriptHost.cpp … … 908 909 inspector/InspectorFrontendClientLocal.cpp 909 910 inspector/InspectorFrontendHost.cpp 911 inspector/InspectorFrontendProxy.cpp 910 912 inspector/InspectorInstrumentation.cpp 911 913 inspector/InspectorProfilerAgent.cpp -
trunk/Source/WebCore/ChangeLog
r83973 r83975 1 2011-04-15 Sergey Vorobyev <sergeyvorobyev@google.com> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: Network events don't preserves, 6 when inspector frontend closed and open again 7 https://bugs.webkit.org/show_bug.cgi?id=58064 8 9 Added InspectorFrontendProxy and EventsCollector. 10 They allow captured messages from InspectorResourceAgent 11 to frontend (or mockFrontend if frontend disabled) and 12 push collected data when frontend reconnect. 13 This functionality is disabled by default. 14 15 * CMakeLists.txt: 16 * GNUmakefile.list.am: 17 * WebCore.gypi: 18 * WebCore.pro: 19 * WebCore.vcproj/WebCore.vcproj: 20 * WebCore.xcodeproj/project.pbxproj: 21 * inspector/EventsCollector.cpp: Added. 22 (WebCore::EventsCollector::EventsCollector): 23 (WebCore::EventsCollector::addEvent): 24 (WebCore::EventsCollector::sendCollectedEvents): 25 * inspector/EventsCollector.h: Added. 26 (WebCore::EventsCollector::~EventsCollector): 27 * inspector/Inspector.json: 28 * inspector/InspectorFrontendProxy.cpp: Added. 29 (WebCore::InspectorFrontendProxy::InspectorFrontendProxy): 30 (WebCore::InspectorFrontendProxy::setInspectorFrontendChannel): 31 (WebCore::InspectorFrontendProxy::setEventsCollector): 32 (WebCore::InspectorFrontendProxy::sendMessageToFrontend): 33 * inspector/InspectorFrontendProxy.h: Added. 34 (WebCore::InspectorFrontendProxy::~InspectorFrontendProxy): 35 * inspector/InspectorInstrumentation.cpp: 36 (WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl): 37 (WebCore::InspectorInstrumentation::loadEventFiredImpl): 38 * inspector/InspectorInstrumentation.h: 39 (WebCore::InspectorInstrumentation::willSendRequest): 40 (WebCore::InspectorInstrumentation::willReceiveResourceResponse): 41 (WebCore::InspectorInstrumentation::didReceiveContentLength): 42 (WebCore::InspectorInstrumentation::didFinishLoading): 43 (WebCore::InspectorInstrumentation::domContentLoadedEventFired): 44 (WebCore::InspectorInstrumentation::loadEventFired): 45 (WebCore::InspectorInstrumentation::frameDetachedFromParent): 46 (WebCore::InspectorInstrumentation::didCreateWebSocket): 47 (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest): 48 (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse): 49 (WebCore::InspectorInstrumentation::didCloseWebSocket): 50 * inspector/InspectorResourceAgent.cpp: 51 (WebCore::InspectorResourceAgent::setFrontend): 52 (WebCore::InspectorResourceAgent::resourceContent): 53 (WebCore::InspectorResourceAgent::~InspectorResourceAgent): 54 (WebCore::InspectorResourceAgent::didReceiveResponse): 55 (WebCore::InspectorResourceAgent::domContentEventFired): 56 (WebCore::InspectorResourceAgent::loadEventFired): 57 (WebCore::InspectorResourceAgent::enabledBackgoundEventsCoollection): 58 (WebCore::InspectorResourceAgent::enable): 59 (WebCore::InspectorResourceAgent::InspectorResourceAgent): 60 * inspector/InspectorResourceAgent.h: 61 * inspector/front-end/NetworkManager.js: 62 (WebInspector.NetworkDispatcher.prototype.domContentEventFired): 63 (WebInspector.NetworkDispatcher.prototype.loadEventFired): 64 * inspector/front-end/inspector.js: 65 (WebInspector.domContentEventFired): 66 (WebInspector.loadEventFired): 67 1 68 2011-04-15 Alexis Menard <alexis.menard@openbossa.org> 2 69 -
trunk/Source/WebCore/GNUmakefile.list.am
r83945 r83975 1922 1922 Source/WebCore/inspector/DOMNodeHighlighter.cpp \ 1923 1923 Source/WebCore/inspector/DOMNodeHighlighter.h \ 1924 Source/WebCore/inspector/EventsCollector.cpp \ 1925 Source/WebCore/inspector/EventsCollector.h \ 1924 1926 Source/WebCore/inspector/InjectedScript.cpp \ 1925 1927 Source/WebCore/inspector/InjectedScript.h \ … … 1962 1964 Source/WebCore/inspector/InspectorFrontendHost.cpp \ 1963 1965 Source/WebCore/inspector/InspectorFrontendHost.h \ 1966 Source/WebCore/inspector/InspectorFrontendProxy.cpp \ 1967 Source/WebCore/inspector/InspectorFrontendProxy.h \ 1964 1968 Source/WebCore/inspector/InspectorInstrumentation.cpp \ 1965 1969 Source/WebCore/inspector/InspectorInstrumentation.h \ -
trunk/Source/WebCore/WebCore.gypi
r83884 r83975 3212 3212 'inspector/DOMNodeHighlighter.cpp', 3213 3213 'inspector/DOMNodeHighlighter.h', 3214 'inspector/EventsCollector.cpp', 3215 'inspector/EventsCollector.h', 3214 3216 'inspector/InjectedScript.cpp', 3215 3217 'inspector/InjectedScript.h', … … 3246 3248 'inspector/InspectorFrontendHost.cpp', 3247 3249 'inspector/InspectorFrontendHost.h', 3250 'inspector/InspectorFrontendProxy.cpp', 3251 'inspector/InspectorFrontendProxy.h', 3248 3252 'inspector/InspectorInstrumentation.cpp', 3249 3253 'inspector/InspectorInstrumentation.h', -
trunk/Source/WebCore/WebCore.pro
r83884 r83975 811 811 inspector/ConsoleMessage.cpp \ 812 812 inspector/DOMNodeHighlighter.cpp \ 813 inspector/EventsCollector.cpp \ 813 814 inspector/InjectedScript.cpp \ 814 815 inspector/InjectedScriptHost.cpp \ … … 829 830 inspector/InspectorFrontendClientLocal.cpp \ 830 831 inspector/InspectorFrontendHost.cpp \ 832 inspector/InspectorFrontendProxy.cpp \ 831 833 inspector/InspectorInstrumentation.cpp \ 832 834 inspector/InspectorPageAgent.cpp \ … … 1745 1747 inspector/ConsoleMessage.h \ 1746 1748 inspector/DOMNodeHighlighter.h \ 1749 inspector/EventsCollector.h \ 1747 1750 inspector/InjectedScript.h \ 1748 1751 inspector/InjectedScriptHost.h \ … … 1761 1764 inspector/InspectorDOMStorageAgent.h \ 1762 1765 inspector/InspectorDOMStorageResource.h \ 1766 inspector/InspectorFrontendChannel.h \ 1763 1767 inspector/InspectorFrontendClient.h \ 1764 1768 inspector/InspectorFrontendClientLocal.h \ 1765 1769 inspector/InspectorFrontendHost.h \ 1770 inspector/InspectorFrontendProxy.h \ 1766 1771 inspector/InspectorInstrumentation.h \ 1767 1772 inspector/InspectorPageAgent.h \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r83884 r83975 66603 66603 </File> 66604 66604 <File 66605 RelativePath="..\inspector\EventsCollector.cpp" 66606 > 66607 </File> 66608 <File 66609 RelativePath="..\inspector\EventsCollector.h" 66610 > 66611 </File> 66612 <File 66605 66613 RelativePath="..\inspector\DOMNodeHighlighter.cpp" 66606 66614 > … … 66768 66776 <File 66769 66777 RelativePath="..\inspector\InspectorFrontendHost.h" 66778 > 66779 </File> 66780 <File 66781 RelativePath="..\inspector\InspectorFrontendProxy.cpp" 66782 > 66783 </File> 66784 <File 66785 RelativePath="..\inspector\InspectorFrontendProxy.h" 66770 66786 > 66771 66787 </File> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r83884 r83975 647 647 20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 20D629251253690B00081543 /* InspectorInstrumentation.h */; }; 648 648 227777601345DEA9008EA455 /* InspectorFrontendChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */; settings = {ATTRIBUTES = (Private, ); }; }; 649 22777B4A134A018C008EA455 /* EventsCollector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22777B48134A018C008EA455 /* EventsCollector.cpp */; }; 650 22777B4B134A018C008EA455 /* EventsCollector.h in Headers */ = {isa = PBXBuildFile; fileRef = 22777B49134A018C008EA455 /* EventsCollector.h */; settings = {ATTRIBUTES = (Private, ); }; }; 651 22777B4E134A01A8008EA455 /* InspectorFrontendProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22777B4C134A01A8008EA455 /* InspectorFrontendProxy.cpp */; }; 652 22777B4F134A01A8008EA455 /* InspectorFrontendProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 22777B4D134A01A8008EA455 /* InspectorFrontendProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; 649 653 22885E641301AE4C00526E68 /* JSDOMImplementationCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22885E631301AE4C00526E68 /* JSDOMImplementationCustom.cpp */; }; 650 654 228C284510D82500009D0D0E /* ScriptWrappable.h in Headers */ = {isa = PBXBuildFile; fileRef = 228C284410D82500009D0D0E /* ScriptWrappable.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 7085 7089 20D629251253690B00081543 /* InspectorInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentation.h; sourceTree = "<group>"; }; 7086 7090 2277775F1345DEA9008EA455 /* InspectorFrontendChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendChannel.h; sourceTree = "<group>"; }; 7091 22777B48134A018C008EA455 /* EventsCollector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventsCollector.cpp; sourceTree = "<group>"; }; 7092 22777B49134A018C008EA455 /* EventsCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventsCollector.h; sourceTree = "<group>"; }; 7093 22777B4C134A01A8008EA455 /* InspectorFrontendProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontendProxy.cpp; sourceTree = "<group>"; }; 7094 22777B4D134A01A8008EA455 /* InspectorFrontendProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendProxy.h; sourceTree = "<group>"; }; 7087 7095 22885E631301AE4C00526E68 /* JSDOMImplementationCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMImplementationCustom.cpp; sourceTree = "<group>"; }; 7088 7096 228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; }; … … 13226 13234 4F1442261339FD6200E0D6F8 /* DOMNodeHighlighter.cpp */, 13227 13235 4F1442271339FD6200E0D6F8 /* DOMNodeHighlighter.h */, 13236 22777B48134A018C008EA455 /* EventsCollector.cpp */, 13237 22777B49134A018C008EA455 /* EventsCollector.h */, 13228 13238 F3644AFD1119805900E0D537 /* InjectedScript.cpp */, 13229 13239 F3644AFE1119805900E0D537 /* InjectedScript.h */, … … 13269 13279 7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */, 13270 13280 7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */, 13281 22777B4C134A01A8008EA455 /* InspectorFrontendProxy.cpp */, 13282 22777B4D134A01A8008EA455 /* InspectorFrontendProxy.h */, 13271 13283 20D629241253690B00081543 /* InspectorInstrumentation.cpp */, 13272 13284 20D629251253690B00081543 /* InspectorInstrumentation.h */, … … 20986 20998 8F67561B1288B17B0047ACA3 /* EventQueue.h in Headers */, 20987 20999 E0FEF372B17C53EAC1C1FBEE /* EventSource.h in Headers */, 21000 22777B4B134A018C008EA455 /* EventsCollector.h in Headers */, 20988 21001 E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */, 20989 21002 BC60D8F30D2A11E000B9918F /* ExceptionBase.h in Headers */, … … 21337 21350 F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */, 21338 21351 7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */, 21352 22777B4F134A01A8008EA455 /* InspectorFrontendProxy.h in Headers */, 21339 21353 20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */, 21340 21354 4F6FDD651341DEDD001F8EE3 /* InspectorPageAgent.h in Headers */, … … 23834 23848 8F67561C1288B17B0047ACA3 /* EventQueue.cpp in Sources */, 23835 23849 E0FEF372B27C53EAC1C1FBEE /* EventSource.cpp in Sources */, 23850 22777B4A134A018C008EA455 /* EventsCollector.cpp in Sources */, 23836 23851 E12EDBEA0B308E0B002704B6 /* EventTarget.cpp in Sources */, 23837 23852 BC60D8F20D2A11E000B9918F /* ExceptionBase.cpp in Sources */, … … 24144 24159 F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */, 24145 24160 7A0E770E10C00A8800A0276E /* InspectorFrontendHost.cpp in Sources */, 24161 22777B4E134A01A8008EA455 /* InspectorFrontendProxy.cpp in Sources */, 24146 24162 20D629261253690B00081543 /* InspectorInstrumentation.cpp in Sources */, 24147 24163 4F6FDD641341DEDD001F8EE3 /* InspectorPageAgent.cpp in Sources */, -
trunk/Source/WebCore/inspector/Inspector.json
r83962 r83975 433 433 ], 434 434 "events": [ 435 { 436 "name": "domContentEventFired", 437 "parameters": [ 438 { "name": "time", "type": "number" } 439 ] 440 }, 441 { 442 "name": "loadEventFired", 443 "parameters": [ 444 { "name": "time", "type": "number" } 445 ] 446 }, 435 447 { 436 448 "name": "frameDetached", -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r83933 r83975 526 526 timelineAgent->didMarkDOMContentEvent(); 527 527 528 if (InspectorResourceAgent* resourceAgent = inspectorAgent->instrumentingAgents()->inspectorResourceAgent()) 529 resourceAgent->domContentEventFired(); 530 528 531 if (InspectorPageAgent* pageAgent = inspectorAgent->instrumentingAgents()->inspectorPageAgent()) 529 532 pageAgent->domContentEventFired(); … … 543 546 if (InspectorTimelineAgent* timelineAgent = inspectorAgent->instrumentingAgents()->inspectorTimelineAgent()) 544 547 timelineAgent->didMarkLoadEvent(); 548 549 if (InspectorResourceAgent* resourceAgent = inspectorAgent->instrumentingAgents()->inspectorResourceAgent()) 550 resourceAgent->loadEventFired(); 545 551 546 552 if (InspectorPageAgent* pageAgent = inspectorAgent->instrumentingAgents()->inspectorPageAgent()) -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r83933 r83975 618 618 { 619 619 #if ENABLE(INSPECTOR) 620 if (InspectorAgent* ic = inspectorAgent WithFrontendForFrame(frame))620 if (InspectorAgent* ic = inspectorAgentForFrame(frame)) 621 621 willSendRequestImpl(ic, identifier, loader, request, redirectResponse); 622 622 #endif … … 657 657 { 658 658 #if ENABLE(INSPECTOR) 659 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForFrame(frame))659 if (InspectorAgent* inspectorAgent = inspectorAgentForFrame(frame)) 660 660 return willReceiveResourceResponseImpl(inspectorAgent, identifier, response); 661 661 #endif … … 690 690 { 691 691 #if ENABLE(INSPECTOR) 692 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForFrame(frame))692 if (InspectorAgent* inspectorAgent = inspectorAgentForFrame(frame)) 693 693 didReceiveContentLengthImpl(inspectorAgent, identifier, dataLength, lengthReceived); 694 694 #endif … … 698 698 { 699 699 #if ENABLE(INSPECTOR) 700 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForFrame(frame))700 if (InspectorAgent* inspectorAgent = inspectorAgentForFrame(frame)) 701 701 didFinishLoadingImpl(inspectorAgent, identifier, finishTime); 702 702 #endif … … 730 730 { 731 731 #if ENABLE(INSPECTOR) 732 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForFrame(frame))732 if (InspectorAgent* inspectorAgent = inspectorAgentForFrame(frame)) 733 733 domContentLoadedEventFiredImpl(inspectorAgent, frame, url); 734 734 #endif … … 738 738 { 739 739 #if ENABLE(INSPECTOR) 740 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForFrame(frame))740 if (InspectorAgent* inspectorAgent = inspectorAgentForFrame(frame)) 741 741 loadEventFiredImpl(inspectorAgent, frame, url); 742 742 #endif … … 746 746 { 747 747 #if ENABLE(INSPECTOR) 748 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForFrame(frame))748 if (InspectorAgent* inspectorAgent = inspectorAgentForFrame(frame)) 749 749 frameDetachedFromParentImpl(inspectorAgent, frame); 750 750 #endif … … 814 814 { 815 815 #if ENABLE(INSPECTOR) 816 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForContext(context))816 if (InspectorAgent* inspectorAgent = inspectorAgentForContext(context)) 817 817 didCreateWebSocketImpl(inspectorAgent, identifier, requestURL, documentURL); 818 818 #endif … … 822 822 { 823 823 #if ENABLE(INSPECTOR) 824 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForContext(context))824 if (InspectorAgent* inspectorAgent = inspectorAgentForContext(context)) 825 825 willSendWebSocketHandshakeRequestImpl(inspectorAgent, identifier, request); 826 826 #endif … … 830 830 { 831 831 #if ENABLE(INSPECTOR) 832 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForContext(context))832 if (InspectorAgent* inspectorAgent = inspectorAgentForContext(context)) 833 833 didReceiveWebSocketHandshakeResponseImpl(inspectorAgent, identifier, response); 834 834 #endif … … 838 838 { 839 839 #if ENABLE(INSPECTOR) 840 if (InspectorAgent* inspectorAgent = inspectorAgent WithFrontendForContext(context))840 if (InspectorAgent* inspectorAgent = inspectorAgentForContext(context)) 841 841 didCloseWebSocketImpl(inspectorAgent, identifier); 842 842 #endif -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r83950 r83975 35 35 36 36 #include "Base64.h" 37 #include "MemoryCache.h"38 37 #include "CachedResource.h" 39 38 #include "CachedResourceLoader.h" 40 39 #include "Document.h" 41 40 #include "DocumentLoader.h" 41 #include "EventsCollector.h" 42 42 #include "Frame.h" 43 43 #include "FrameLoader.h" … … 46 46 #include "HTTPHeaderMap.h" 47 47 #include "InspectorFrontend.h" 48 #include "InspectorFrontendChannel.h" 49 #include "InspectorFrontendProxy.h" 48 50 #include "InspectorState.h" 49 51 #include "InspectorValues.h" 50 52 #include "InstrumentingAgents.h" 51 53 #include "KURL.h" 54 #include "MemoryCache.h" 52 55 #include "Page.h" 53 56 #include "ProgressTracker.h" … … 89 92 { 90 93 m_frontend = frontend->network(); 94 if (backgroundEventsCollectionEnabled()) { 95 // Insert Message Proxy in receiver chain. 96 InspectorFrontendChannel* client = m_frontend->getInspectorFrontendChannel(); 97 m_inspectorFrontendProxy->setInspectorFrontendChannel(client); 98 m_frontend->setInspectorFrontendChannel(m_inspectorFrontendProxy.get()); 99 m_eventsCollector->sendCollectedEvents(client); 100 } 91 101 } 92 102 93 103 void InspectorResourceAgent::clearFrontend() 94 104 { 95 m_frontend = 0; 105 if (backgroundEventsCollectionEnabled()) { 106 m_inspectorFrontendProxy->setInspectorFrontendChannel(0); 107 m_frontend = m_mockFrontend.get(); 108 } else 109 m_frontend = 0; 96 110 disable(0); 97 111 } … … 106 120 { 107 121 if (!frame) { 108 *errorString = "No frame to get resource content for"; 122 *errorString = "No frame to get resource content for"; 109 123 return; 110 124 } … … 286 300 InspectorResourceAgent::~InspectorResourceAgent() 287 301 { 302 if (m_state->getBoolean(ResourceAgentState::resourceAgentEnabled)) { 303 ErrorString error; 304 disable(&error); 305 } 288 306 ASSERT(!m_instrumentingAgents->inspectorResourceAgent()); 289 307 } … … 379 397 } 380 398 399 void InspectorResourceAgent::domContentEventFired() 400 { 401 m_frontend->domContentEventFired(currentTime()); 402 } 403 404 void InspectorResourceAgent::loadEventFired() 405 { 406 m_frontend->loadEventFired(currentTime()); 407 } 408 381 409 static PassRefPtr<InspectorObject> buildObjectForFrame(Frame* frame) 382 410 { … … 491 519 } 492 520 521 bool InspectorResourceAgent::backgroundEventsCollectionEnabled() 522 { 523 // FIXME (https://bugs.webkit.org/show_bug.cgi?id=58652) 524 // Add here condition to enable background events collection. 525 // Now this function is disable. 526 return false; 527 } 528 493 529 void InspectorResourceAgent::enable(ErrorString*) 494 530 { … … 537 573 , m_page(page) 538 574 , m_state(state) 539 , m_frontend(0) 540 { 575 { 576 if (backgroundEventsCollectionEnabled()) { 577 m_eventsCollector = new EventsCollector(); 578 m_inspectorFrontendProxy = new InspectorFrontendProxy(m_eventsCollector.get()); 579 // Create mock frontend, so we can collect network events. 580 m_mockFrontend = new InspectorFrontend::Network(m_inspectorFrontendProxy.get()); 581 m_frontend = m_mockFrontend.get(); 582 enable(); 583 } else 584 m_frontend = 0; 541 585 } 542 586 -
trunk/Source/WebCore/inspector/InspectorResourceAgent.h
r82847 r83975 35 35 #include "PlatformString.h" 36 36 37 #include <wtf/OwnPtr.h> 37 38 #include <wtf/PassRefPtr.h> 38 39 #include <wtf/Vector.h> … … 52 53 class InspectorArray; 53 54 class InspectorFrontend; 55 class InspectorFrontendProxy; 54 56 class InspectorObject; 55 57 class InspectorState; 56 58 class InstrumentingAgents; 57 59 class KURL; 60 class EventsCollector; 58 61 class Page; 59 62 class ResourceError; … … 98 101 void setInitialScriptContent(unsigned long identifier, const String& sourceString); 99 102 void setInitialXHRContent(unsigned long identifier, const String& sourceString); 103 void domContentEventFired(); 104 void loadEventFired(); 100 105 void didCommitLoad(DocumentLoader*); 101 106 void frameDetachedFromParent(Frame*); … … 109 114 110 115 Frame* frameForId(const String& frameId); 116 bool backgroundEventsCollectionEnabled(); 111 117 112 118 // Called from frontend … … 125 131 Page* m_page; 126 132 InspectorState* m_state; 133 OwnPtr<EventsCollector> m_eventsCollector; 127 134 InspectorFrontend::Network* m_frontend; 135 OwnPtr<InspectorFrontend::Network> m_mockFrontend; 136 OwnPtr<InspectorFrontendProxy> m_inspectorFrontendProxy; 128 137 }; 129 138 -
trunk/Source/WebCore/inspector/front-end/NetworkManager.js
r83950 r83975 154 154 }, 155 155 156 domContentEventFired: function(time) 157 { 158 if (WebInspector.panels.network) 159 WebInspector.panels.network.mainResourceDOMContentTime = time; 160 }, 161 162 loadEventFired: function(time) 163 { 164 if (WebInspector.panels.network) 165 WebInspector.panels.network.mainResourceLoadTime = time; 166 }, 167 156 168 dataReceived: function(identifier, time, dataLength, lengthReceived) 157 169 { -
trunk/Source/WebCore/inspector/front-end/inspector.js
r83968 r83975 980 980 { 981 981 this.panels.audits.mainResourceDOMContentTime = time; 982 if (this.panels.network)983 this.panels.network.mainResourceDOMContentTime = time;984 982 this.mainResourceDOMContentTime = time; 985 983 } … … 988 986 { 989 987 this.panels.audits.mainResourceLoadTime = time; 990 this.panels.network.mainResourceLoadTime = time;991 988 this.panels.resources.loadEventFired(); 992 989 this.mainResourceLoadTime = time;
Note: See TracChangeset
for help on using the changeset viewer.