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

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

Issue 445023005: DevTools: reduce ResourceAgent dependency on PageAgent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index a8cd4ba8b08750ca47e09d0a49a451b0a7b2b600..a2b32a71a97139bcd3d7ffed14427ba38144df54 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -38,6 +38,7 @@
#include "core/dom/ExecutionContextTask.h"
#include "core/fetch/Resource.h"
#include "core/inspector/ContentSearchUtils.h"
+#include "core/inspector/EditedResourcesContentManager.h"
#include "core/inspector/InjectedScriptManager.h"
#include "core/inspector/InspectorPageAgent.h"
#include "core/inspector/InspectorState.h"
@@ -111,9 +112,10 @@ static String generateBreakpointId(const String& scriptId, int lineNumber, int c
return scriptId + ':' + String::number(lineNumber) + ':' + String::number(columnNumber) + breakpointIdSuffix(source);
}
-InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedScriptManager)
+InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedScriptManager, EditedResourcesContentManager* editedResourcesContentManager)
vsevik 2014/08/08 11:40:59 Please check whether we actually need this for deb
eustas 2014/08/08 14:03:07 Acknowledged.
: InspectorBaseAgent<InspectorDebuggerAgent>("Debugger")
, m_injectedScriptManager(injectedScriptManager)
+ , m_editedResourcesContentManager(editedResourcesContentManager)
, m_frontend(0)
, m_pausedScriptState(nullptr)
, m_javaScriptPauseScheduled(false)
@@ -640,8 +642,7 @@ void InspectorDebuggerAgent::setScriptSource(ErrorString* error, RefPtr<TypeBuil
String url = it->value.url;
if (url.isEmpty())
return;
- if (InspectorPageAgent* pageAgent = m_instrumentingAgents->inspectorPageAgent())
- pageAgent->addEditedResourceContent(url, newContent);
+ m_editedResourcesContentManager->add(url, newContent);
}
void InspectorDebuggerAgent::restartFrame(ErrorString* errorString, const String& callFrameId, RefPtr<Array<CallFrame> >& newCallFrames, RefPtr<JSONObject>& result, RefPtr<StackTrace>& asyncStackTrace)
@@ -672,11 +673,9 @@ void InspectorDebuggerAgent::getScriptSource(ErrorString* error, const String& s
String url = it->value.url;
if (!url.isEmpty()) {
- if (InspectorPageAgent* pageAgent = m_instrumentingAgents->inspectorPageAgent()) {
- bool success = pageAgent->getEditedResourceContent(url, scriptSource);
- if (success)
- return;
- }
+ bool success = m_editedResourcesContentManager->get(url, scriptSource);
+ if (success)
+ return;
}
*scriptSource = it->value.source;
}
@@ -1447,6 +1446,7 @@ void InspectorDebuggerAgent::reset()
void InspectorDebuggerAgent::trace(Visitor* visitor)
{
visitor->trace(m_injectedScriptManager);
+ visitor->trace(m_editedResourcesContentManager);
visitor->trace(m_listener);
InspectorBaseAgent::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698