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

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

Issue 1240373002: Revert of [DevTools] Remove edited scripts from debugger agent, move knowledge to frontend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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/InspectorDebuggerAgent.h ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index e41e0f8c0adbd6dcee9a50a2004aeb3dbddeb0c7..ee00ba7faa9dd3eb5f4112ffa93099de8ed7d5f0 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -621,7 +621,10 @@
ScriptsMap::iterator it = m_scripts.find(scriptId);
if (it == m_scripts.end())
return;
- it->value.setSource(newContent);
+ String url = it->value.url();
+ if (url.isEmpty())
+ return;
+ m_editedScripts.set(url, newContent);
}
void InspectorDebuggerAgent::restartFrame(ErrorString* errorString, const String& callFrameId, RefPtr<Array<CallFrame> >& newCallFrames, RefPtr<JSONObject>& result, RefPtr<StackTrace>& asyncStackTrace)
@@ -653,6 +656,10 @@
*error = "No script for id: " + scriptId;
return;
}
+
+ String url = it->value.url();
+ if (!url.isEmpty() && getEditedScript(url, scriptSource))
+ return;
*scriptSource = it->value.source();
}
@@ -1419,6 +1426,14 @@
m_skipNextDebuggerStepOut = true;
}
}
+}
+
+bool InspectorDebuggerAgent::getEditedScript(const String& url, String* content)
+{
+ if (!m_editedScripts.contains(url))
+ return false;
+ *content = m_editedScripts.get(url);
+ return true;
}
PassRefPtr<Array<CallFrame> > InspectorDebuggerAgent::currentCallFrames()
@@ -1716,6 +1731,11 @@
frontend()->globalObjectCleared();
}
+void InspectorDebuggerAgent::resetModifiedSources()
+{
+ m_editedScripts.clear();
+}
+
DEFINE_TRACE(InspectorDebuggerAgent)
{
#if ENABLE(OILPAN)
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698