Changeset 80332 in webkit
- Timestamp:
- Mar 4, 2011 12:28:36 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r80331 r80332 1 2011-03-03 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: AppCache agent should have same lifetime as InspectorAgent 6 https://bugs.webkit.org/show_bug.cgi?id=55673 7 8 * inspector/InspectorAgent.cpp: 9 (WebCore::InspectorAgent::InspectorAgent): 10 (WebCore::InspectorAgent::setFrontend): 11 (WebCore::InspectorAgent::disconnectFrontend): 12 (WebCore::InspectorAgent::createFrontendLifetimeAgents): 13 (WebCore::InspectorAgent::releaseFrontendLifetimeAgents): 14 (WebCore::InspectorAgent::didCommitLoad): 15 * inspector/InspectorApplicationCacheAgent.cpp: 16 (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent): 17 (WebCore::InspectorApplicationCacheAgent::setFrontend): 18 (WebCore::InspectorApplicationCacheAgent::clearFrontend): 19 * inspector/InspectorApplicationCacheAgent.h: 20 * inspector/InspectorInstrumentation.cpp: 21 (WebCore::InspectorInstrumentation::networkStateChangedImpl): 22 (WebCore::InspectorInstrumentation::updateApplicationCacheStatusImpl): 23 * inspector/InstrumentingAgents.h: 24 (WebCore::InstrumentingAgents::inspectorApplicationCacheAgent): 25 (WebCore::InstrumentingAgents::setInspectorApplicationCacheAgent): 26 1 27 2011-03-03 Brian Weinstein <bweinstein@apple.com> 2 28 -
trunk/Source/WebCore/inspector/InspectorAgent.cpp
r80239 r80332 149 149 , m_state(new InspectorState(client)) 150 150 , m_timelineAgent(InspectorTimelineAgent::create(m_instrumentingAgents.get(), m_state.get())) 151 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 152 , m_applicationCacheAgent(new InspectorApplicationCacheAgent(m_instrumentingAgents.get(), page)) 153 #endif 151 154 , m_resourceAgent(InspectorResourceAgent::create(m_instrumentingAgents.get(), page, m_state.get())) 152 155 , m_consoleAgent(new InspectorConsoleAgent(m_instrumentingAgents.get(), this, m_state.get(), m_injectedScriptHost.get(), m_domAgent.get())) … … 366 369 createFrontendLifetimeAgents(); 367 370 371 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 372 m_applicationCacheAgent->setFrontend(m_frontend); 373 #endif 368 374 m_domAgent->setFrontend(m_frontend); 369 375 m_consoleAgent->setFrontend(m_frontend); … … 407 413 m_profilerAgent->clearFrontend(); 408 414 m_profilerAgent->stopUserInitiatedProfiling(true); 415 #endif 416 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 417 m_applicationCacheAgent->clearFrontend(); 409 418 #endif 410 419 … … 427 436 { 428 437 m_runtimeAgent = InspectorRuntimeAgent::create(m_injectedScriptHost.get()); 429 430 #if ENABLE(OFFLINE_WEB_APPLICATIONS)431 m_applicationCacheAgent = new InspectorApplicationCacheAgent(m_inspectedPage->mainFrame()->loader()->documentLoader(), m_frontend);432 #endif433 438 } 434 439 … … 436 441 { 437 442 m_runtimeAgent.clear(); 438 #if ENABLE(OFFLINE_WEB_APPLICATIONS)439 m_applicationCacheAgent.clear();440 #endif441 443 } 442 444 … … 519 521 if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspectorTimelineAgent()) 520 522 timelineAgent->didCommitLoad(); 521 522 #if ENABLE(OFFLINE_WEB_APPLICATIONS)523 if (m_applicationCacheAgent)524 m_applicationCacheAgent->didCommitLoad(loader);525 #endif526 523 527 524 #if ENABLE(JAVASCRIPT_DEBUGGER) -
trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
r80204 r80332 36 36 #include "InspectorFrontend.h" 37 37 #include "InspectorValues.h" 38 #include "InstrumentingAgents.h" 38 39 #include "NetworkStateNotifier.h" 39 40 #include "Page.h" … … 42 43 namespace WebCore { 43 44 44 InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(DocumentLoader* documentLoader, InspectorFrontend* frontend) 45 : m_documentLoader(documentLoader) 46 , m_frontend(frontend->applicationcache()) 45 InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(InstrumentingAgents* instrumentingAgents, Page* inspectedPage) 46 : m_instrumentingAgents(instrumentingAgents) 47 , m_inspectedPage(inspectedPage) 48 , m_frontend(0) 47 49 { 48 50 } 49 51 50 void InspectorApplicationCacheAgent:: didCommitLoad(DocumentLoader* documentLoader)52 void InspectorApplicationCacheAgent::setFrontend(InspectorFrontend* frontend) 51 53 { 52 m_documentLoader = documentLoader; 54 m_frontend = frontend->applicationcache(); 55 m_instrumentingAgents->setInspectorApplicationCacheAgent(this); 56 } 57 58 void InspectorApplicationCacheAgent::clearFrontend() 59 { 60 m_instrumentingAgents->setInspectorApplicationCacheAgent(0); 61 m_frontend = 0; 53 62 } 54 63 … … 67 76 void InspectorApplicationCacheAgent::getApplicationCaches(ErrorString*, RefPtr<InspectorValue>* applicationCaches) 68 77 { 69 if (m_documentLoader) { 70 ApplicationCacheHost* host = m_documentLoader->applicationCacheHost(); 71 ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo(); 78 DocumentLoader* documentLoader = m_inspectedPage->mainFrame()->loader()->documentLoader(); 79 if (!documentLoader) 80 return; 81 ApplicationCacheHost* host = documentLoader->applicationCacheHost(); 82 ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo(); 72 83 73 ApplicationCacheHost::ResourceInfoList resources; 74 host->fillResourceList(&resources); 75 *applicationCaches = buildObjectForApplicationCache(resources, info); 76 } 84 ApplicationCacheHost::ResourceInfoList resources; 85 host->fillResourceList(&resources); 86 *applicationCaches = buildObjectForApplicationCache(resources, info); 77 87 } 78 88 -
trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h
r80204 r80332 35 35 namespace WebCore { 36 36 37 class DocumentLoader;38 37 class Frame; 39 38 class InspectorArray; … … 42 41 class InspectorObject; 43 42 class InspectorValue; 43 class InstrumentingAgents; 44 class Page; 44 45 class ResourceResponse; 45 46 … … 49 50 WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATED; 50 51 public: 51 InspectorApplicationCacheAgent( DocumentLoader*, InspectorFrontend*);52 InspectorApplicationCacheAgent(InstrumentingAgents*, Page*); 52 53 ~InspectorApplicationCacheAgent() { } 53 54 54 void didCommitLoad(DocumentLoader*); 55 void setFrontend(InspectorFrontend*); 56 void clearFrontend(); 55 57 56 58 // Backend to Frontend … … 66 68 PassRefPtr<InspectorObject> buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&); 67 69 68 DocumentLoader* m_documentLoader; 70 InstrumentingAgents* m_instrumentingAgents; 71 Page* m_inspectedPage; 69 72 InspectorFrontend::ApplicationCache* m_frontend; 70 73 }; -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r80239 r80332 655 655 void InspectorInstrumentation::networkStateChangedImpl(InspectorAgent* inspectorAgent) 656 656 { 657 if (InspectorApplicationCacheAgent* applicationCacheAgent = inspectorAgent-> applicationCacheAgent())657 if (InspectorApplicationCacheAgent* applicationCacheAgent = inspectorAgent->instrumentingAgents()->inspectorApplicationCacheAgent()) 658 658 applicationCacheAgent->networkStateChanged(); 659 659 } … … 661 661 void InspectorInstrumentation::updateApplicationCacheStatusImpl(InspectorAgent* inspectorAgent, Frame* frame) 662 662 { 663 if (InspectorApplicationCacheAgent* applicationCacheAgent = inspectorAgent-> applicationCacheAgent())663 if (InspectorApplicationCacheAgent* applicationCacheAgent = inspectorAgent->instrumentingAgents()->inspectorApplicationCacheAgent()) 664 664 applicationCacheAgent->updateApplicationCacheStatus(frame); 665 665 } -
trunk/Source/WebCore/inspector/InstrumentingAgents.h
r79217 r80332 37 37 namespace WebCore { 38 38 39 class InspectorApplicationCacheAgent; 39 40 class InspectorBrowserDebuggerAgent; 40 41 class InspectorConsoleAgent; … … 55 56 InstrumentingAgents() 56 57 : m_inspectorBrowserDebuggerAgent(0) 58 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 59 , m_inspectorApplicationCacheAgent(0) 60 #endif 57 61 , m_inspectorConsoleAgent(0) 58 62 , m_inspectorDOMAgent(0) … … 70 74 InspectorBrowserDebuggerAgent* inspectorBrowserDebuggerAgent() const { return m_inspectorBrowserDebuggerAgent; } 71 75 void setInspectorBrowserDebuggerAgent(InspectorBrowserDebuggerAgent* agent) { m_inspectorBrowserDebuggerAgent = agent; } 76 77 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 78 InspectorApplicationCacheAgent* inspectorApplicationCacheAgent() const { return m_inspectorApplicationCacheAgent; } 79 void setInspectorApplicationCacheAgent(InspectorApplicationCacheAgent* agent) { m_inspectorApplicationCacheAgent = agent; } 80 #endif 72 81 73 82 InspectorConsoleAgent* inspectorConsoleAgent() const { return m_inspectorConsoleAgent; } … … 103 112 private: 104 113 InspectorBrowserDebuggerAgent* m_inspectorBrowserDebuggerAgent; 114 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 115 InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent; 116 #endif 105 117 InspectorConsoleAgent* m_inspectorConsoleAgent; 106 118 InspectorDOMAgent* m_inspectorDOMAgent;
Note: See TracChangeset
for help on using the changeset viewer.