Lines Matching defs:script
16 #include "src/inspector/injected-script.h"
23 #include "src/inspector/v8-debugger-script.h"
147 // The script and source position are not encoded in this case.
181 String16 breakpointHint(const V8DebuggerScript& script, int lineNumber,
183 int offset = script.offset(lineNumber, columnNumber);
186 script.source(offset, kBreakpointHintMaxLength).stripWhiteSpace();
195 void adjustBreakpointLocation(const V8DebuggerScript& script,
198 if (*lineNumber < script.startLine() || *lineNumber > script.endLine())
200 if (*lineNumber == script.startLine() &&
201 *columnNumber < script.startColumn()) {
204 if (*lineNumber == script.endLine() && script.endColumn() < *columnNumber) {
209 intptr_t sourceOffset = script.offset(*lineNumber, *columnNumber);
215 String16 searchArea = script.source(searchRegionOffset,
233 script.location(static_cast<int>(bestMatch));
387 for (auto& script : compiledScripts) {
388 didParseSource(std::move(script), true);
502 static bool matches(V8InspectorImpl* inspector, const V8DebuggerScript& script,
506 return script.sourceURL() == selector;
508 return script.hash() == selector;
511 return regex.match(script.sourceURL()) != -1;
514 return script.scriptId() == selector;
587 for (const auto& script : m_scripts) {
588 if (!matches(m_inspector, *script.second, type, selector)) continue;
590 adjustBreakpointLocation(*script.second, hint, &lineNumber,
594 breakpointId, script.first, condition, lineNumber, columnNumber);
596 hint = breakpointHint(*script.second, location->getLineNumber(),
725 V8DebuggerScript* script = scriptIter.second.get();
726 if (script->getLanguage() == V8DebuggerScript::Language::WebAssembly) {
727 scripts.push_back(script);
748 for (auto& script : scripts) {
749 script->removeWasmBreakpoint(id);
791 return Response::ServerError("Cannot retrive script context");
832 V8DebuggerScript* script = it->second.get();
833 int contextId = script->executionContextId();
840 m_session->contextGroupId(), script, std::move(location),
902 // Ranges array contains positions in script where blackbox state is changed.
950 V8DebuggerScript* script = scriptIterator->second.get();
951 if (lineNumber < script->startLine() || script->endLine() < lineNumber) {
954 if (lineNumber == script->startLine() &&
955 columnNumber < script->startColumn()) {
958 if (lineNumber == script->endLine() && script->endColumn() < columnNumber) {
964 int contextId = script->executionContextId();
970 if (!script->setBreakpoint(condition, &location, &debuggerBreakpointId)) {
1006 return Response::ServerError("No script for id: " + scriptId.utf8());
1026 return Response::ServerError("No script with given id found");
1087 return Response::ServerError("No script for id: " + scriptId.utf8());
1108 return Response::ServerError("No script for id: " + scriptId.utf8());
1410 return Response::ServerError("No script with passed id.");
1477 v8::Local<v8::debug::Script> script = iterator->GetScript();
1478 DCHECK(!script.IsEmpty());
1481 .setScriptId(String16::fromInteger(script->Id()))
1543 static String16 getScriptLanguage(const V8DebuggerScript& script) {
1544 switch (script.getLanguage()) {
1571 const V8DebuggerScript& script) {
1573 if (!script.getDebugSymbolsType().To(&type)) return {};
1580 if (script.getExternalDebugSymbolsURL().To(&externalUrl)) {
1588 std::unique_ptr<V8DebuggerScript> script, bool success) {
1591 String16 scriptSource = script->source(0);
1592 script->setSourceURL(findSourceURL(scriptSource, false));
1593 script->setSourceMappingURL(findSourceMapURL(scriptSource, false));
1596 int contextId = script->executionContextId();
1611 bool isLiveEdit = script->isLiveEdit();
1612 bool hasSourceURLComment = script->hasSourceURLComment();
1613 bool isModule = script->isModule();
1614 String16 scriptId = script->scriptId();
1615 String16 scriptURL = script->sourceURL();
1616 String16 embedderName = script->embedderName();
1617 String16 scriptLanguage = getScriptLanguage(*script);
1621 if (script->getLanguage() == V8DebuggerScript::Language::WebAssembly)
1622 codeOffset = script->codeOffset();
1623 debugSymbols = getDebugSymbols(*script);
1626 m_scripts[scriptId] = std::move(script);
1628 // one that holds the script. Has to be done after script added to m_scripts.
1637 // script is changing.
1769 const auto& script = m_scripts[scriptId];
1772 breakAuxData->setString("scriptId", script->scriptId());
1773 breakAuxData->setString("url", script->sourceURL());
1774 if (!script->sourceMappingURL().isEmpty()) {
1775 breakAuxData->setString("sourceMapURL", (script->sourceMappingURL()));
1958 void V8DebuggerAgentImpl::ScriptCollected(const V8DebuggerScript* script) {
1959 DCHECK_NE(m_scripts.find(script->scriptId()), m_scripts.end());
1963 if (script->wasmBytecode().To(&span)) {
1968 CachedScript cachedScript{script->scriptId(), script->source(0),
1972 m_scripts.erase(script->scriptId());
1992 return Response::ServerError("No script with passed id.");