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

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

Issue 1092123004: DevTools: remove dependency of most agents on InspectorPageAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: further cuts on InspectorPageAgent inter-agents API 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
Index: Source/core/inspector/InspectorPageAgent.cpp
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index 5a27c827c06b660ccfa1764f7f6295dc35b0fd2e..5b771e462db8304290ed1d04557552b0375b983d 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -199,10 +199,6 @@ PassOwnPtr<TextResourceDecoder> InspectorPageAgent::createResourceTextDecoder(co
static void resourceContent(ErrorString* errorString, LocalFrame* frame, const KURL& url, String* result, bool* base64Encoded)
{
- DocumentLoader* loader = InspectorPageAgent::assertDocumentLoader(errorString, frame);
- if (!loader)
- return;
-
if (!InspectorPageAgent::cachedResourceContent(InspectorPageAgent::cachedResource(frame, url), result, base64Encoded))
*errorString = "No resource with given URL found";
}
@@ -396,7 +392,7 @@ void InspectorPageAgent::enable(ErrorString*)
m_instrumentingAgents->setInspectorPageAgent(this);
if (m_inspectorResourceContentLoader)
m_inspectorResourceContentLoader->dispose();
- m_inspectorResourceContentLoader = adoptPtrWillBeNoop(new InspectorResourceContentLoader(inspectedFrame()));
+ m_inspectorResourceContentLoader = adoptPtrWillBeNoop(new InspectorResourceContentLoader(m_inspectedFrame));
}
void InspectorPageAgent::discardAgent()
@@ -458,12 +454,12 @@ void InspectorPageAgent::reload(ErrorString*, const bool* const optionalIgnoreCa
ErrorString unused;
m_debuggerAgent->setSkipAllPauses(&unused, true);
m_reloading = true;
- inspectedFrame()->reload(asBool(optionalIgnoreCache) ? EndToEndReload : NormalReload, NotClientRedirect);
+ m_inspectedFrame->reload(asBool(optionalIgnoreCache) ? EndToEndReload : NormalReload, NotClientRedirect);
}
void InspectorPageAgent::navigate(ErrorString*, const String& url, String* outFrameId)
{
- *outFrameId = frameId(inspectedFrame());
+ *outFrameId = frameId(m_inspectedFrame);
}
static void cachedResourcesForDocument(Document* document, Vector<Resource*>& result, bool skipXHRs)
@@ -527,7 +523,7 @@ static Vector<Resource*> cachedResourcesForFrame(LocalFrame* frame, bool skipXHR
void InspectorPageAgent::getResourceTree(ErrorString*, RefPtr<TypeBuilder::Page::FrameResourceTree>& object)
{
- object = buildObjectForFrameTree(inspectedFrame());
+ object = buildObjectForFrameTree(m_inspectedFrame);
}
void InspectorPageAgent::finishReload()
@@ -641,21 +637,21 @@ void InspectorPageAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
void InspectorPageAgent::domContentLoadedEventFired(LocalFrame* frame)
{
- if (frame != inspectedFrame())
+ if (frame != m_inspectedFrame)
return;
frontend()->domContentEventFired(monotonicallyIncreasingTime());
}
void InspectorPageAgent::loadEventFired(LocalFrame* frame)
{
- if (frame != inspectedFrame())
+ if (frame != m_inspectedFrame)
return;
frontend()->loadEventFired(monotonicallyIncreasingTime());
}
void InspectorPageAgent::didCommitLoad(LocalFrame*, DocumentLoader* loader)
{
- if (loader->frame() == inspectedFrame()) {
+ if (loader->frame() == m_inspectedFrame) {
finishReload();
m_scriptToEvaluateOnLoadOnce = m_pendingScriptToEvaluateOnLoadOnce;
m_pendingScriptToEvaluateOnLoadOnce = String();
@@ -678,11 +674,6 @@ void InspectorPageAgent::frameDetachedFromParent(LocalFrame* frame)
frontend()->frameDetached(frameId(frame));
}
-FrameHost* InspectorPageAgent::frameHost()
-{
- return m_inspectedFrame->host();
-}
-
LocalFrame* InspectorPageAgent::frameForId(const String& frameId)
{
LocalFrame* frame = InspectorIdentifiers<LocalFrame>::lookup(frameId);
@@ -691,7 +682,7 @@ LocalFrame* InspectorPageAgent::frameForId(const String& frameId)
LocalFrame* InspectorPageAgent::findFrameWithSecurityOrigin(const String& originRawString)
{
- for (Frame* frame = inspectedFrame(); frame; frame = frame->tree().traverseNext(inspectedFrame())) {
+ for (Frame* frame = m_inspectedFrame; frame; frame = frame->tree().traverseNext(m_inspectedFrame)) {
if (!frame->isLocalFrame())
continue;
RefPtr<SecurityOrigin> documentOrigin = toLocalFrame(frame)->document()->securityOrigin();
@@ -714,15 +705,6 @@ bool InspectorPageAgent::screencastEnabled()
return m_enabled && m_state->getBoolean(PageAgentState::screencastEnabled);
}
-// static
-DocumentLoader* InspectorPageAgent::assertDocumentLoader(ErrorString* errorString, LocalFrame* frame)
-{
- DocumentLoader* documentLoader = frame->loader().documentLoader();
- if (!documentLoader)
- *errorString = "No documentLoader for given frame found";
- return documentLoader;
-}
-
void InspectorPageAgent::frameStartedLoading(LocalFrame* frame)
{
frontend()->frameStartedLoading(frameId(frame));
@@ -768,7 +750,7 @@ void InspectorPageAgent::didScroll()
void InspectorPageAgent::didResizeMainFrame()
{
- if (!inspectedFrame()->isMainFrame())
+ if (!m_inspectedFrame->isMainFrame())
return;
#if !OS(ANDROID)
if (m_enabled && m_state->getBoolean(PageAgentState::showSizeOnResize))

Powered by Google App Engine
This is Rietveld 408576698