| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/Parser.h" | 7 #include "platform/inspector_protocol/Parser.h" |
| 8 #include "platform/inspector_protocol/String16.h" | 8 #include "platform/inspector_protocol/String16.h" |
| 9 #include "platform/inspector_protocol/Values.h" | 9 #include "platform/inspector_protocol/Values.h" |
| 10 #include "platform/v8_inspector/InjectedScript.h" | 10 #include "platform/v8_inspector/InjectedScript.h" |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 if (m_pausedContext.IsEmpty()) | 975 if (m_pausedContext.IsEmpty()) |
| 976 return nullptr; | 976 return nullptr; |
| 977 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); | 977 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); |
| 978 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) : nu
llptr; | 978 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) : nu
llptr; |
| 979 } | 979 } |
| 980 | 980 |
| 981 void V8DebuggerAgentImpl::didParseSource(std::unique_ptr<V8DebuggerScript> scrip
t, bool success) | 981 void V8DebuggerAgentImpl::didParseSource(std::unique_ptr<V8DebuggerScript> scrip
t, bool success) |
| 982 { | 982 { |
| 983 v8::HandleScope handles(m_isolate); | 983 v8::HandleScope handles(m_isolate); |
| 984 String16 scriptSource = toProtocolString(script->source(m_isolate)); | 984 String16 scriptSource = toProtocolString(script->source(m_isolate)); |
| 985 bool isDeprecatedSourceURL = false; | |
| 986 if (!success) | 985 if (!success) |
| 987 script->setSourceURL(findSourceURL(scriptSource, false, &isDeprecatedSou
rceURL)); | 986 script->setSourceURL(findSourceURL(scriptSource, false)); |
| 988 else if (script->hasSourceURL()) | |
| 989 findSourceURL(scriptSource, false, &isDeprecatedSourceURL); | |
| 990 | |
| 991 bool isDeprecatedSourceMappingURL = false; | |
| 992 if (!success) | 987 if (!success) |
| 993 script->setSourceMappingURL(findSourceMapURL(scriptSource, false, &isDep
recatedSourceMappingURL)); | 988 script->setSourceMappingURL(findSourceMapURL(scriptSource, false)); |
| 994 else if (!script->sourceMappingURL().isEmpty()) | |
| 995 findSourceMapURL(scriptSource, false, &isDeprecatedSourceMappingURL); | |
| 996 | 989 |
| 997 std::unique_ptr<protocol::DictionaryValue> executionContextAuxData; | 990 std::unique_ptr<protocol::DictionaryValue> executionContextAuxData; |
| 998 if (!script->executionContextAuxData().isEmpty()) | 991 if (!script->executionContextAuxData().isEmpty()) |
| 999 executionContextAuxData = protocol::DictionaryValue::cast(parseJSON(scri
pt->executionContextAuxData())); | 992 executionContextAuxData = protocol::DictionaryValue::cast(parseJSON(scri
pt->executionContextAuxData())); |
| 1000 bool isInternalScript = script->isInternalScript(); | 993 bool isInternalScript = script->isInternalScript(); |
| 1001 bool isLiveEdit = script->isLiveEdit(); | 994 bool isLiveEdit = script->isLiveEdit(); |
| 1002 bool hasSourceURL = script->hasSourceURL(); | 995 bool hasSourceURL = script->hasSourceURL(); |
| 1003 String16 scriptId = script->scriptId(); | 996 String16 scriptId = script->scriptId(); |
| 1004 String16 scriptURL = script->sourceURL(); | 997 String16 scriptURL = script->sourceURL(); |
| 1005 bool deprecatedCommentWasUsed = isDeprecatedSourceURL || isDeprecatedSourceM
appingURL; | |
| 1006 | 998 |
| 1007 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); | 999 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); |
| 1008 const Maybe<protocol::DictionaryValue>& executionContextAuxDataParam(std::mo
ve(executionContextAuxData)); | 1000 const Maybe<protocol::DictionaryValue>& executionContextAuxDataParam(std::mo
ve(executionContextAuxData)); |
| 1009 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n
ullptr; | 1001 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n
ullptr; |
| 1010 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; | 1002 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; |
| 1011 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; | 1003 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; |
| 1012 const bool* deprecatedCommentWasUsedParam = deprecatedCommentWasUsed ? &depr
ecatedCommentWasUsed : nullptr; | |
| 1013 if (success) | 1004 if (success) |
| 1014 m_frontend.scriptParsed(scriptId, scriptURL, script->startLine(), script
->startColumn(), script->endLine(), script->endColumn(), script->executionContex
tId(), script->hash(), executionContextAuxDataParam, isInternalScriptParam, isLi
veEditParam, sourceMapURLParam, hasSourceURLParam, deprecatedCommentWasUsedParam
); | 1005 m_frontend.scriptParsed(scriptId, scriptURL, script->startLine(), script
->startColumn(), script->endLine(), script->endColumn(), script->executionContex
tId(), script->hash(), executionContextAuxDataParam, isInternalScriptParam, isLi
veEditParam, sourceMapURLParam, hasSourceURLParam); |
| 1015 else | 1006 else |
| 1016 m_frontend.scriptFailedToParse(scriptId, scriptURL, script->startLine(),
script->startColumn(), script->endLine(), script->endColumn(), script->executio
nContextId(), script->hash(), executionContextAuxDataParam, isInternalScriptPara
m, sourceMapURLParam, hasSourceURLParam, deprecatedCommentWasUsedParam); | 1007 m_frontend.scriptFailedToParse(scriptId, scriptURL, script->startLine(),
script->startColumn(), script->endLine(), script->endColumn(), script->executio
nContextId(), script->hash(), executionContextAuxDataParam, isInternalScriptPara
m, sourceMapURLParam, hasSourceURLParam); |
| 1017 | 1008 |
| 1018 m_scripts[scriptId] = std::move(script); | 1009 m_scripts[scriptId] = std::move(script); |
| 1019 | 1010 |
| 1020 if (scriptURL.isEmpty() || !success) | 1011 if (scriptURL.isEmpty() || !success) |
| 1021 return; | 1012 return; |
| 1022 | 1013 |
| 1023 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg
entState::javaScriptBreakpoints); | 1014 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg
entState::javaScriptBreakpoints); |
| 1024 if (!breakpointsCookie) | 1015 if (!breakpointsCookie) |
| 1025 return; | 1016 return; |
| 1026 | 1017 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 { | 1172 { |
| 1182 if (!enabled()) | 1173 if (!enabled()) |
| 1183 return; | 1174 return; |
| 1184 m_scheduledDebuggerStep = NoStep; | 1175 m_scheduledDebuggerStep = NoStep; |
| 1185 m_scripts.clear(); | 1176 m_scripts.clear(); |
| 1186 m_blackboxedPositions.clear(); | 1177 m_blackboxedPositions.clear(); |
| 1187 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1178 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1188 } | 1179 } |
| 1189 | 1180 |
| 1190 } // namespace blink | 1181 } // namespace blink |
| OLD | NEW |