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

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

Issue 1217773007: [DevTools] Replace reportCompiledScripts with explicit [get]compiledScripts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: getCompiledScripts 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 unified diff | Download patch | Annotate | Revision Log
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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script, Compi leResult compileResult) 1467 String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script, Compi leResult compileResult)
1468 { 1468 {
1469 bool hasSyntaxError = compileResult != CompileSuccess; 1469 bool hasSyntaxError = compileResult != CompileSuccess;
1470 if (!hasSyntaxError) 1470 if (!hasSyntaxError)
1471 return script.sourceMappingURL(); 1471 return script.sourceMappingURL();
1472 return ContentSearchUtils::findSourceMapURL(script.source(), ContentSearchUt ils::JavaScriptMagicComment); 1472 return ContentSearchUtils::findSourceMapURL(script.source(), ContentSearchUt ils::JavaScriptMagicComment);
1473 } 1473 }
1474 1474
1475 // ScriptDebugListener functions 1475 // ScriptDebugListener functions
1476 1476
1477 void InspectorDebuggerAgent::didParseSource(const String& scriptId, const Script & parsedScript, CompileResult compileResult) 1477 void InspectorDebuggerAgent::didParseSource(const ParsedScript& parsedScript)
1478 { 1478 {
1479 Script script = parsedScript; 1479 Script script = parsedScript.script;
1480 1480
1481 bool hasSyntaxError = compileResult != CompileSuccess; 1481 bool hasSyntaxError = parsedScript.compileResult != CompileSuccess;
1482 if (hasSyntaxError) 1482 if (hasSyntaxError)
1483 script.setSourceURL(ContentSearchUtils::findSourceURL(script.source(), C ontentSearchUtils::JavaScriptMagicComment)); 1483 script.setSourceURL(ContentSearchUtils::findSourceURL(script.source(), C ontentSearchUtils::JavaScriptMagicComment));
1484 1484
1485 bool isContentScript = script.isContentScript(); 1485 bool isContentScript = script.isContentScript();
1486 bool isInternalScript = script.isInternalScript(); 1486 bool isInternalScript = script.isInternalScript();
1487 bool hasSourceURL = script.hasSourceURL(); 1487 bool hasSourceURL = script.hasSourceURL();
1488 String scriptURL = script.sourceURL(); 1488 String scriptURL = script.sourceURL();
1489 String sourceMapURL = sourceMapURLForScript(script, compileResult); 1489 String sourceMapURL = sourceMapURLForScript(script, parsedScript.compileResu lt);
1490 1490
1491 const String* sourceMapURLParam = sourceMapURL.isNull() ? nullptr : &sourceM apURL; 1491 const String* sourceMapURLParam = sourceMapURL.isNull() ? nullptr : &sourceM apURL;
1492 const bool* isContentScriptParam = isContentScript ? &isContentScript : null ptr; 1492 const bool* isContentScriptParam = isContentScript ? &isContentScript : null ptr;
1493 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n ullptr; 1493 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n ullptr;
1494 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; 1494 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr;
1495 if (!hasSyntaxError) 1495 if (!hasSyntaxError)
1496 frontend()->scriptParsed(scriptId, scriptURL, script.startLine(), script .startColumn(), script.endLine(), script.endColumn(), isContentScriptParam, isIn ternalScriptParam, sourceMapURLParam, hasSourceURLParam); 1496 frontend()->scriptParsed(parsedScript.scriptId, scriptURL, script.startL ine(), script.startColumn(), script.endLine(), script.endColumn(), isContentScri ptParam, isInternalScriptParam, sourceMapURLParam, hasSourceURLParam);
1497 else 1497 else
1498 frontend()->scriptFailedToParse(scriptId, scriptURL, script.startLine(), script.startColumn(), script.endLine(), script.endColumn(), isContentScriptPara m, isInternalScriptParam, sourceMapURLParam, hasSourceURLParam); 1498 frontend()->scriptFailedToParse(parsedScript.scriptId, scriptURL, script .startLine(), script.startColumn(), script.endLine(), script.endColumn(), isCont entScriptParam, isInternalScriptParam, sourceMapURLParam, hasSourceURLParam);
1499 1499
1500 m_scripts.set(scriptId, script); 1500 m_scripts.set(parsedScript.scriptId, script);
1501 1501
1502 if (scriptURL.isEmpty() || hasSyntaxError) 1502 if (scriptURL.isEmpty() || hasSyntaxError)
1503 return; 1503 return;
1504 1504
1505 RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState ::javaScriptBreakpoints); 1505 RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState ::javaScriptBreakpoints);
1506 for (auto& cookie : *breakpointsCookie) { 1506 for (auto& cookie : *breakpointsCookie) {
1507 RefPtr<JSONObject> breakpointObject = cookie.value->asObject(); 1507 RefPtr<JSONObject> breakpointObject = cookie.value->asObject();
1508 bool isRegex; 1508 bool isRegex;
1509 breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex); 1509 breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex);
1510 String url; 1510 String url;
1511 breakpointObject->getString(DebuggerAgentState::url, &url); 1511 breakpointObject->getString(DebuggerAgentState::url, &url);
1512 if (!matches(scriptURL, url, isRegex)) 1512 if (!matches(scriptURL, url, isRegex))
1513 continue; 1513 continue;
1514 ScriptBreakpoint breakpoint; 1514 ScriptBreakpoint breakpoint;
1515 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint. lineNumber); 1515 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint. lineNumber);
1516 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin t.columnNumber); 1516 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin t.columnNumber);
1517 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c ondition); 1517 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c ondition);
1518 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(coo kie.key, scriptId, breakpoint, UserBreakpointSource); 1518 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(coo kie.key, parsedScript.scriptId, breakpoint, UserBreakpointSource);
1519 if (location) 1519 if (location)
1520 frontend()->breakpointResolved(cookie.key, location); 1520 frontend()->breakpointResolved(cookie.key, location);
1521 } 1521 }
1522 } 1522 }
1523 1523
1524 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::didPause(ScriptSta te* scriptState, const ScriptValue& callFrames, const ScriptValue& exception, co nst Vector<String>& hitBreakpoints, bool isPromiseRejection) 1524 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::didPause(ScriptSta te* scriptState, const ScriptValue& callFrames, const ScriptValue& exception, co nst Vector<String>& hitBreakpoints, bool isPromiseRejection)
1525 { 1525 {
1526 ScriptDebugListener::SkipPauseRequest result; 1526 ScriptDebugListener::SkipPauseRequest result;
1527 if (m_skipAllPauses) 1527 if (m_skipAllPauses)
1528 result = ScriptDebugListener::Continue; 1528 result = ScriptDebugListener::Continue;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 RefPtr<ExceptionDetails> exceptionDetails = ExceptionDetails::create().setTe xt(toCoreStringWithUndefinedOrNullCheck(message->Get())); 1712 RefPtr<ExceptionDetails> exceptionDetails = ExceptionDetails::create().setTe xt(toCoreStringWithUndefinedOrNullCheck(message->Get()));
1713 exceptionDetails->setLine(message->GetLineNumber()); 1713 exceptionDetails->setLine(message->GetLineNumber());
1714 exceptionDetails->setColumn(message->GetStartColumn()); 1714 exceptionDetails->setColumn(message->GetStartColumn());
1715 v8::Local<v8::StackTrace> messageStackTrace = message->GetStackTrace(); 1715 v8::Local<v8::StackTrace> messageStackTrace = message->GetStackTrace();
1716 if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount() > 0) 1716 if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount() > 0)
1717 exceptionDetails->setStackTrace(createScriptCallStack(isolate, messageSt ackTrace, messageStackTrace->GetFrameCount())->buildInspectorArray()); 1717 exceptionDetails->setStackTrace(createScriptCallStack(isolate, messageSt ackTrace, messageStackTrace->GetFrameCount())->buildInspectorArray());
1718 return exceptionDetails.release(); 1718 return exceptionDetails.release();
1719 } 1719 }
1720 1720
1721 } // namespace blink 1721 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/MainThreadDebugger.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698