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

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

Issue 470143002: DevTools: Take sourceURL into consideration in debugger agent when matching script url. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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
« no previous file with comments | « no previous file | no next file » | 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 f8a2db269c2ab28dbbb0487a141806514562c298..477bb3537feb3a59f19bb6baf7651b87d8f2b049 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -304,6 +304,12 @@ static PassRefPtr<JSONObject> buildObjectForBreakpointCookie(const String& url,
return breakpointObject;
}
+static String scriptSourceURL(const ScriptDebugListener::Script& script)
+{
+ bool hasSourceURL = !script.sourceURL.isEmpty();
+ return hasSourceURL ? script.sourceURL : script.url;
+}
+
static bool matches(const String& url, const String& pattern, bool isRegex)
{
if (isRegex) {
@@ -350,7 +356,7 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int li
if (!isAntiBreakpointValue) {
ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition);
for (ScriptsMap::iterator it = m_scripts.begin(); it != m_scripts.end(); ++it) {
- if (!matches(it->value.url, url, isRegex))
+ if (!matches(scriptSourceURL(it->value), url, isRegex))
continue;
RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(breakpointId, it->key, breakpoint, UserBreakpointSource);
if (location)
@@ -486,7 +492,7 @@ String InspectorDebuggerAgent::scriptURL(JavaScriptCallFrame* frame)
ScriptsMap::iterator it = m_scripts.find(scriptIdString);
if (it == m_scripts.end())
return String();
- return it->value.url;
+ return scriptSourceURL(it->value);
}
ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptionPause()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698