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/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
9 #include "platform/v8_inspector/InjectedScript.h" | 9 #include "platform/v8_inspector/InjectedScript.h" |
10 #include "platform/v8_inspector/InspectedContext.h" | 10 #include "platform/v8_inspector/InspectedContext.h" |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 script->setSourceURL(findSourceURL(scriptSource, false, &isDeprecatedSou
rceURL)); | 1000 script->setSourceURL(findSourceURL(scriptSource, false, &isDeprecatedSou
rceURL)); |
1001 else if (script->hasSourceURL()) | 1001 else if (script->hasSourceURL()) |
1002 findSourceURL(scriptSource, false, &isDeprecatedSourceURL); | 1002 findSourceURL(scriptSource, false, &isDeprecatedSourceURL); |
1003 | 1003 |
1004 bool isDeprecatedSourceMappingURL = false; | 1004 bool isDeprecatedSourceMappingURL = false; |
1005 if (!success) | 1005 if (!success) |
1006 script->setSourceMappingURL(findSourceMapURL(scriptSource, false, &isDep
recatedSourceMappingURL)); | 1006 script->setSourceMappingURL(findSourceMapURL(scriptSource, false, &isDep
recatedSourceMappingURL)); |
1007 else if (!script->sourceMappingURL().isEmpty()) | 1007 else if (!script->sourceMappingURL().isEmpty()) |
1008 findSourceMapURL(scriptSource, false, &isDeprecatedSourceMappingURL); | 1008 findSourceMapURL(scriptSource, false, &isDeprecatedSourceMappingURL); |
1009 | 1009 |
1010 bool isContentScript = script->isContentScript(); | 1010 std::unique_ptr<protocol::Value> executionContextAuxData; |
| 1011 if (!script->executionContextAuxData().isEmpty()) |
| 1012 executionContextAuxData = protocol::SerializedValue::create(script->exec
utionContextAuxData()); |
1011 bool isInternalScript = script->isInternalScript(); | 1013 bool isInternalScript = script->isInternalScript(); |
1012 bool isLiveEdit = script->isLiveEdit(); | 1014 bool isLiveEdit = script->isLiveEdit(); |
1013 bool hasSourceURL = script->hasSourceURL(); | 1015 bool hasSourceURL = script->hasSourceURL(); |
1014 String16 scriptId = script->scriptId(); | 1016 String16 scriptId = script->scriptId(); |
1015 String16 scriptURL = script->sourceURL(); | 1017 String16 scriptURL = script->sourceURL(); |
1016 bool deprecatedCommentWasUsed = isDeprecatedSourceURL || isDeprecatedSourceM
appingURL; | 1018 bool deprecatedCommentWasUsed = isDeprecatedSourceURL || isDeprecatedSourceM
appingURL; |
1017 | 1019 |
1018 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); | 1020 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); |
1019 const bool* isContentScriptParam = isContentScript ? &isContentScript : null
ptr; | 1021 const Maybe<protocol::Value>& executionContextAuxDataParam(std::move(executi
onContextAuxData)); |
1020 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n
ullptr; | 1022 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n
ullptr; |
1021 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; | 1023 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; |
1022 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; | 1024 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; |
1023 const bool* deprecatedCommentWasUsedParam = deprecatedCommentWasUsed ? &depr
ecatedCommentWasUsed : nullptr; | 1025 const bool* deprecatedCommentWasUsedParam = deprecatedCommentWasUsed ? &depr
ecatedCommentWasUsed : nullptr; |
1024 if (success) | 1026 if (success) |
1025 m_frontend.scriptParsed(scriptId, scriptURL, script->startLine(), script
->startColumn(), script->endLine(), script->endColumn(), script->executionContex
tId(), script->hash(), isContentScriptParam, isInternalScriptParam, isLiveEditPa
ram, sourceMapURLParam, hasSourceURLParam, deprecatedCommentWasUsedParam); | 1027 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
); |
1026 else | 1028 else |
1027 m_frontend.scriptFailedToParse(scriptId, scriptURL, script->startLine(),
script->startColumn(), script->endLine(), script->endColumn(), script->executio
nContextId(), script->hash(), isContentScriptParam, isInternalScriptParam, sourc
eMapURLParam, hasSourceURLParam, deprecatedCommentWasUsedParam); | 1029 m_frontend.scriptFailedToParse(scriptId, scriptURL, script->startLine(),
script->startColumn(), script->endLine(), script->endColumn(), script->executio
nContextId(), script->hash(), executionContextAuxDataParam, isInternalScriptPara
m, sourceMapURLParam, hasSourceURLParam, deprecatedCommentWasUsedParam); |
1028 | 1030 |
1029 m_scripts[scriptId] = std::move(script); | 1031 m_scripts[scriptId] = std::move(script); |
1030 | 1032 |
1031 if (scriptURL.isEmpty() || !success) | 1033 if (scriptURL.isEmpty() || !success) |
1032 return; | 1034 return; |
1033 | 1035 |
1034 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg
entState::javaScriptBreakpoints); | 1036 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg
entState::javaScriptBreakpoints); |
1035 if (!breakpointsCookie) | 1037 if (!breakpointsCookie) |
1036 return; | 1038 return; |
1037 | 1039 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 { | 1194 { |
1193 if (!enabled()) | 1195 if (!enabled()) |
1194 return; | 1196 return; |
1195 m_scheduledDebuggerStep = NoStep; | 1197 m_scheduledDebuggerStep = NoStep; |
1196 m_scripts.clear(); | 1198 m_scripts.clear(); |
1197 m_blackboxedPositions.clear(); | 1199 m_blackboxedPositions.clear(); |
1198 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1200 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1199 } | 1201 } |
1200 | 1202 |
1201 } // namespace blink | 1203 } // namespace blink |
OLD | NEW |