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

Side by Side Diff: Source/core/inspector/InspectorDebuggerAgent.cpp

Issue 272613002: DevTools: implemented scriptFailedToParse protocol event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 ScriptBreakpoint breakpoint; 1150 ScriptBreakpoint breakpoint;
1151 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint. lineNumber); 1151 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint. lineNumber);
1152 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin t.columnNumber); 1152 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin t.columnNumber);
1153 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c ondition); 1153 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c ondition);
1154 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it- >key, scriptId, breakpoint, UserBreakpointSource); 1154 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it- >key, scriptId, breakpoint, UserBreakpointSource);
1155 if (location) 1155 if (location)
1156 m_frontend->breakpointResolved(it->key, location); 1156 m_frontend->breakpointResolved(it->key, location);
1157 } 1157 }
1158 } 1158 }
1159 1159
1160 void InspectorDebuggerAgent::failedToParseSource(const String& url, const String & data, int firstLine, int errorLine, const String& errorMessage) 1160 void InspectorDebuggerAgent::failedToParseSource(const String& scriptId, const S cript& script)
1161 { 1161 {
1162 m_frontend->scriptFailedToParse(url, data, firstLine, errorLine, errorMessag e); 1162 const bool* isContentScript = script.isContentScript ? &script.isContentScri pt : 0;
1163 String sourceMapURL = sourceMapURLForScript(script);
1164 String* sourceMapURLParam = sourceMapURL.isNull() ? 0 : &sourceMapURL;
1165 String sourceURL;
1166 if (!script.startLine && !script.startColumn) {
1167 bool deprecated;
1168 sourceURL = ContentSearchUtils::findSourceURL(script.source, ContentSear chUtils::JavaScriptMagicComment, &deprecated);
1169 // FIXME: add deprecated console message here.
1170 }
1171 bool hasSourceURL = !sourceURL.isEmpty();
1172 String scriptURL = hasSourceURL ? sourceURL : script.url;
1173 bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : 0;
1174 m_frontend->scriptFailedToParse(scriptId, scriptURL, script.startLine, scrip t.startColumn, script.endLine, script.endColumn, isContentScript, sourceMapURLPa ram, hasSourceURLParam);
1175
1176 m_scripts.set(scriptId, script);
1177
1178 if (scriptURL.isEmpty())
1179 return;
1180
1181 RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState ::javaScriptBreakpoints);
vsevik 2014/06/27 12:35:14 We don't care about breakpoints for scripts that h
1182 for (JSONObject::iterator it = breakpointsCookie->begin(); it != breakpoints Cookie->end(); ++it) {
1183 RefPtr<JSONObject> breakpointObject = it->value->asObject();
1184 bool isAntibreakpoint;
1185 breakpointObject->getBoolean(DebuggerAgentState::isAnti, &isAntibreakpoi nt);
1186 if (isAntibreakpoint)
1187 continue;
1188 bool isRegex;
1189 breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex);
1190 String url;
1191 breakpointObject->getString(DebuggerAgentState::url, &url);
1192 if (!matches(scriptURL, url, isRegex))
1193 continue;
1194 ScriptBreakpoint breakpoint;
1195 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint. lineNumber);
1196 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin t.columnNumber);
1197 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c ondition);
1198 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it- >key, scriptId, breakpoint, UserBreakpointSource);
1199 if (location)
1200 m_frontend->breakpointResolved(it->key, location);
1201 }
1163 } 1202 }
1164 1203
1165 void InspectorDebuggerAgent::didPause(ScriptState* scriptState, const ScriptValu e& callFrames, const ScriptValue& exception, const Vector<String>& hitBreakpoint s) 1204 void InspectorDebuggerAgent::didPause(ScriptState* scriptState, const ScriptValu e& callFrames, const ScriptValue& exception, const Vector<String>& hitBreakpoint s)
1166 { 1205 {
1167 ASSERT(scriptState && !m_pausedScriptState); 1206 ASSERT(scriptState && !m_pausedScriptState);
1168 m_pausedScriptState = scriptState; 1207 m_pausedScriptState = scriptState;
1169 m_currentCallStack = callFrames; 1208 m_currentCallStack = callFrames;
1170 1209
1171 m_skipStepInCount = numberOfStepsBeforeStepOut; 1210 m_skipStepInCount = numberOfStepsBeforeStepOut;
1172 1211
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 m_scripts.clear(); 1312 m_scripts.clear();
1274 m_breakpointIdToDebugServerBreakpointIds.clear(); 1313 m_breakpointIdToDebugServerBreakpointIds.clear();
1275 m_asyncCallStackTracker.clear(); 1314 m_asyncCallStackTracker.clear();
1276 m_promiseTracker.clear(); 1315 m_promiseTracker.clear();
1277 if (m_frontend) 1316 if (m_frontend)
1278 m_frontend->globalObjectCleared(); 1317 m_frontend->globalObjectCleared();
1279 } 1318 }
1280 1319
1281 } // namespace WebCore 1320 } // namespace WebCore
1282 1321
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698