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/String16.h" | 8 #include "platform/inspector_protocol/String16.h" |
8 #include "platform/inspector_protocol/Values.h" | 9 #include "platform/inspector_protocol/Values.h" |
9 #include "platform/v8_inspector/InjectedScript.h" | 10 #include "platform/v8_inspector/InjectedScript.h" |
10 #include "platform/v8_inspector/InspectedContext.h" | 11 #include "platform/v8_inspector/InspectedContext.h" |
11 #include "platform/v8_inspector/JavaScriptCallFrame.h" | 12 #include "platform/v8_inspector/JavaScriptCallFrame.h" |
12 #include "platform/v8_inspector/RemoteObjectId.h" | 13 #include "platform/v8_inspector/RemoteObjectId.h" |
13 #include "platform/v8_inspector/ScriptBreakpoint.h" | 14 #include "platform/v8_inspector/ScriptBreakpoint.h" |
14 #include "platform/v8_inspector/V8Debugger.h" | 15 #include "platform/v8_inspector/V8Debugger.h" |
15 #include "platform/v8_inspector/V8DebuggerScript.h" | 16 #include "platform/v8_inspector/V8DebuggerScript.h" |
16 #include "platform/v8_inspector/V8InspectorImpl.h" | 17 #include "platform/v8_inspector/V8InspectorImpl.h" |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 script->setSourceURL(findSourceURL(scriptSource, false, &isDeprecatedSou
rceURL)); | 1001 script->setSourceURL(findSourceURL(scriptSource, false, &isDeprecatedSou
rceURL)); |
1001 else if (script->hasSourceURL()) | 1002 else if (script->hasSourceURL()) |
1002 findSourceURL(scriptSource, false, &isDeprecatedSourceURL); | 1003 findSourceURL(scriptSource, false, &isDeprecatedSourceURL); |
1003 | 1004 |
1004 bool isDeprecatedSourceMappingURL = false; | 1005 bool isDeprecatedSourceMappingURL = false; |
1005 if (!success) | 1006 if (!success) |
1006 script->setSourceMappingURL(findSourceMapURL(scriptSource, false, &isDep
recatedSourceMappingURL)); | 1007 script->setSourceMappingURL(findSourceMapURL(scriptSource, false, &isDep
recatedSourceMappingURL)); |
1007 else if (!script->sourceMappingURL().isEmpty()) | 1008 else if (!script->sourceMappingURL().isEmpty()) |
1008 findSourceMapURL(scriptSource, false, &isDeprecatedSourceMappingURL); | 1009 findSourceMapURL(scriptSource, false, &isDeprecatedSourceMappingURL); |
1009 | 1010 |
1010 bool isContentScript = script->isContentScript(); | 1011 std::unique_ptr<protocol::DictionaryValue> executionContextAuxData; |
| 1012 if (!script->executionContextAuxData().isEmpty()) |
| 1013 executionContextAuxData = protocol::DictionaryValue::cast(parseJSON(scri
pt->executionContextAuxData())); |
1011 bool isInternalScript = script->isInternalScript(); | 1014 bool isInternalScript = script->isInternalScript(); |
1012 bool isLiveEdit = script->isLiveEdit(); | 1015 bool isLiveEdit = script->isLiveEdit(); |
1013 bool hasSourceURL = script->hasSourceURL(); | 1016 bool hasSourceURL = script->hasSourceURL(); |
1014 String16 scriptId = script->scriptId(); | 1017 String16 scriptId = script->scriptId(); |
1015 String16 scriptURL = script->sourceURL(); | 1018 String16 scriptURL = script->sourceURL(); |
1016 bool deprecatedCommentWasUsed = isDeprecatedSourceURL || isDeprecatedSourceM
appingURL; | 1019 bool deprecatedCommentWasUsed = isDeprecatedSourceURL || isDeprecatedSourceM
appingURL; |
1017 | 1020 |
1018 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); | 1021 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); |
1019 const bool* isContentScriptParam = isContentScript ? &isContentScript : null
ptr; | 1022 const Maybe<protocol::DictionaryValue>& executionContextAuxDataParam(std::mo
ve(executionContextAuxData)); |
1020 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n
ullptr; | 1023 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n
ullptr; |
1021 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; | 1024 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; |
1022 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; | 1025 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; |
1023 const bool* deprecatedCommentWasUsedParam = deprecatedCommentWasUsed ? &depr
ecatedCommentWasUsed : nullptr; | 1026 const bool* deprecatedCommentWasUsedParam = deprecatedCommentWasUsed ? &depr
ecatedCommentWasUsed : nullptr; |
1024 if (success) | 1027 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); | 1028 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 | 1029 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); | 1030 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 | 1031 |
1029 m_scripts[scriptId] = std::move(script); | 1032 m_scripts[scriptId] = std::move(script); |
1030 | 1033 |
1031 if (scriptURL.isEmpty() || !success) | 1034 if (scriptURL.isEmpty() || !success) |
1032 return; | 1035 return; |
1033 | 1036 |
1034 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg
entState::javaScriptBreakpoints); | 1037 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg
entState::javaScriptBreakpoints); |
1035 if (!breakpointsCookie) | 1038 if (!breakpointsCookie) |
1036 return; | 1039 return; |
1037 | 1040 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 { | 1195 { |
1193 if (!enabled()) | 1196 if (!enabled()) |
1194 return; | 1197 return; |
1195 m_scheduledDebuggerStep = NoStep; | 1198 m_scheduledDebuggerStep = NoStep; |
1196 m_scripts.clear(); | 1199 m_scripts.clear(); |
1197 m_blackboxedPositions.clear(); | 1200 m_blackboxedPositions.clear(); |
1198 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1201 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1199 } | 1202 } |
1200 | 1203 |
1201 } // namespace blink | 1204 } // namespace blink |
OLD | NEW |