Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1277)

Unified Diff: Source/core/inspector/InspectorApplicationCacheAgent.cpp

Issue 1118963002: Revert of DevTools: remove dependency of most agents on InspectorPageAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorApplicationCacheAgent.h ('k') | Source/core/inspector/InspectorCSSAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorApplicationCacheAgent.cpp
diff --git a/Source/core/inspector/InspectorApplicationCacheAgent.cpp b/Source/core/inspector/InspectorApplicationCacheAgent.cpp
index f91242d8c71c95e617385ff8307ad4ab41ce8640..89bc12b67bd648a170346ff0f0ef5b6c4fae2f1b 100644
--- a/Source/core/inspector/InspectorApplicationCacheAgent.cpp
+++ b/Source/core/inspector/InspectorApplicationCacheAgent.cpp
@@ -28,7 +28,7 @@
#include "core/frame/LocalFrame.h"
#include "core/inspector/InspectorIdentifiers.h"
-#include "core/inspector/InspectorResolver.h"
+#include "core/inspector/InspectorPageAgent.h"
#include "core/inspector/InspectorState.h"
#include "core/inspector/InstrumentingAgents.h"
#include "core/loader/DocumentLoader.h"
@@ -42,9 +42,9 @@
static const char applicationCacheAgentEnabled[] = "applicationCacheAgentEnabled";
}
-InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(LocalFrame* inspectedFrame)
+InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(InspectorPageAgent* pageAgent)
: InspectorBaseAgent<InspectorApplicationCacheAgent, InspectorFrontend::ApplicationCache>("ApplicationCache")
- , m_inspectedFrame(inspectedFrame)
+ , m_pageAgent(pageAgent)
{
}
@@ -86,7 +86,7 @@
void InspectorApplicationCacheAgent::networkStateChanged(LocalFrame* frame, bool online)
{
- if (frame == m_inspectedFrame)
+ if (frame == m_pageAgent->inspectedFrame())
frontend()->networkStateUpdated(online);
}
@@ -94,7 +94,8 @@
{
result = TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest>::create();
- for (Frame* frame = m_inspectedFrame; frame; frame = frame->tree().traverseNext(m_inspectedFrame)) {
+ LocalFrame* inspectedFrame = m_pageAgent->inspectedFrame();
+ for (Frame* frame = inspectedFrame; frame; frame = frame->tree().traverseNext(inspectedFrame)) {
if (!frame->isLocalFrame())
continue;
DocumentLoader* documentLoader = toLocalFrame(frame)->loader().documentLoader();
@@ -116,17 +117,11 @@
DocumentLoader* InspectorApplicationCacheAgent::assertFrameWithDocumentLoader(ErrorString* errorString, String frameId)
{
- LocalFrame* frame = InspectorResolver::resolveFrame(m_inspectedFrame, frameId);
- if (!frame) {
- *errorString = "No frame for given id found";
+ LocalFrame* frame = m_pageAgent->assertFrame(errorString, frameId);
+ if (!frame)
return nullptr;
- }
- DocumentLoader* documentLoader = frame->loader().documentLoader();
- if (!documentLoader) {
- *errorString = "No documentLoader for given frame found";
- return nullptr;
- }
- return documentLoader;
+
+ return InspectorPageAgent::assertDocumentLoader(errorString, frame);
}
void InspectorApplicationCacheAgent::getManifestForFrame(ErrorString* errorString, const String& frameId, String* manifestURL)
@@ -204,7 +199,7 @@
DEFINE_TRACE(InspectorApplicationCacheAgent)
{
- visitor->trace(m_inspectedFrame);
+ visitor->trace(m_pageAgent);
InspectorBaseAgent::trace(visitor);
}
« no previous file with comments | « Source/core/inspector/InspectorApplicationCacheAgent.h ('k') | Source/core/inspector/InspectorCSSAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698