Commit a957931c authored by vsevik@chromium.org's avatar vsevik@chromium.org

DevTools: Take sourceURL into consideration in debugger agent when matching script url.

R=aandrey

Review URL: https://codereview.chromium.org/470143002

git-svn-id: svn://svn.chromium.org/blink/trunk@180264 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8a60ceb7
...@@ -304,6 +304,12 @@ static PassRefPtr<JSONObject> buildObjectForBreakpointCookie(const String& url, ...@@ -304,6 +304,12 @@ static PassRefPtr<JSONObject> buildObjectForBreakpointCookie(const String& url,
return breakpointObject; 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) static bool matches(const String& url, const String& pattern, bool isRegex)
{ {
if (isRegex) { if (isRegex) {
...@@ -350,7 +356,7 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int li ...@@ -350,7 +356,7 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int li
if (!isAntiBreakpointValue) { if (!isAntiBreakpointValue) {
ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition); ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition);
for (ScriptsMap::iterator it = m_scripts.begin(); it != m_scripts.end(); ++it) { 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; continue;
RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(breakpointId, it->key, breakpoint, UserBreakpointSource); RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(breakpointId, it->key, breakpoint, UserBreakpointSource);
if (location) if (location)
...@@ -486,7 +492,7 @@ String InspectorDebuggerAgent::scriptURL(JavaScriptCallFrame* frame) ...@@ -486,7 +492,7 @@ String InspectorDebuggerAgent::scriptURL(JavaScriptCallFrame* frame)
ScriptsMap::iterator it = m_scripts.find(scriptIdString); ScriptsMap::iterator it = m_scripts.find(scriptIdString);
if (it == m_scripts.end()) if (it == m_scripts.end())
return String(); return String();
return it->value.url; return scriptSourceURL(it->value);
} }
ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptionPause() ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptionPause()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment