void DebuggerImpl::HandleSourceEvent()

in lib/Debugger.ProtocolHandler/DebuggerImpl.cpp [413:471]


    void DebuggerImpl::HandleSourceEvent(const DebuggerScript& script, bool success)
    {
        String16 scriptId = script.ScriptId();
        String16 scriptUrl = script.SourceUrl();

        std::unique_ptr<protocol::DictionaryValue> executionContextAuxData;
        if (!script.ExecutionContextAuxData().empty())
        {
            executionContextAuxData = protocol::DictionaryValue::cast(
                protocol::StringUtil::parseJSON(script.ExecutionContextAuxData()));
        }

        if (success)
        {
            m_frontend.scriptParsed(
                scriptId,
                scriptUrl,
                script.StartLine(),
                script.StartColumn(),
                script.EndLine(),
                script.EndColumn(),
                script.ExecutionContextId(),
                script.Hash(),
                std::move(executionContextAuxData),
                script.IsLiveEdit(),
                script.SourceMappingUrl(),
                script.HasSourceUrl());
        }
        else
        {
            m_frontend.scriptFailedToParse(
                scriptId,
                scriptUrl,
                script.StartLine(),
                script.StartColumn(),
                script.EndLine(),
                script.EndColumn(),
                script.ExecutionContextId(),
                script.Hash(),
                std::move(executionContextAuxData),
                script.SourceMappingUrl(),
                script.HasSourceUrl());
        }

        m_scriptMap.emplace(scriptId, script);

        for (auto& breakpoint : m_breakpointMap)
        {
            if (breakpoint.second.TryLoadScript(script))
            {
                if (TryResolveBreakpoint(breakpoint.second))
                {
                    m_frontend.breakpointResolved(
                        breakpoint.first,
                        breakpoint.second.GetActualLocation());
                }
            }
        }
    }