Chromium Code Reviews| 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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 989 if (m_pausedContext.IsEmpty()) | 989 if (m_pausedContext.IsEmpty()) |
| 990 return nullptr; | 990 return nullptr; |
| 991 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); | 991 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); |
| 992 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) : nu llptr; | 992 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) : nu llptr; |
| 993 } | 993 } |
| 994 | 994 |
| 995 void V8DebuggerAgentImpl::didParseSource(std::unique_ptr<V8DebuggerScript> scrip t, bool success) | 995 void V8DebuggerAgentImpl::didParseSource(std::unique_ptr<V8DebuggerScript> scrip t, bool success) |
| 996 { | 996 { |
| 997 v8::HandleScope handles(m_isolate); | 997 v8::HandleScope handles(m_isolate); |
| 998 String16 scriptSource = toProtocolString(script->source(m_isolate)); | 998 String16 scriptSource = toProtocolString(script->source(m_isolate)); |
| 999 bool isDeprecatedSourceURL = false; | |
| 1000 if (!success) | 999 if (!success) |
| 1001 script->setSourceURL(findSourceURL(scriptSource, false, &isDeprecatedSou rceURL)); | 1000 script->setSourceURL(findSourceURL(scriptSource, false)); |
| 1002 else if (script->hasSourceURL()) | |
| 1003 findSourceURL(scriptSource, false, &isDeprecatedSourceURL); | |
|
dgozman
2016/08/10 23:06:25
Leave the support please.
kozy
2016/08/12 18:59:32
Done.
| |
| 1004 | |
| 1005 bool isDeprecatedSourceMappingURL = false; | |
| 1006 if (!success) | 1001 if (!success) |
| 1007 script->setSourceMappingURL(findSourceMapURL(scriptSource, false, &isDep recatedSourceMappingURL)); | 1002 script->setSourceMappingURL(findSourceMapURL(scriptSource, false)); |
| 1008 else if (!script->sourceMappingURL().isEmpty()) | |
| 1009 findSourceMapURL(scriptSource, false, &isDeprecatedSourceMappingURL); | |
|
dgozman
2016/08/10 23:06:26
ditto
kozy
2016/08/12 18:59:31
Done.
| |
| 1010 | 1003 |
| 1011 std::unique_ptr<protocol::DictionaryValue> executionContextAuxData; | 1004 std::unique_ptr<protocol::DictionaryValue> executionContextAuxData; |
| 1012 if (!script->executionContextAuxData().isEmpty()) | 1005 if (!script->executionContextAuxData().isEmpty()) |
| 1013 executionContextAuxData = protocol::DictionaryValue::cast(parseJSON(scri pt->executionContextAuxData())); | 1006 executionContextAuxData = protocol::DictionaryValue::cast(parseJSON(scri pt->executionContextAuxData())); |
| 1014 bool isInternalScript = script->isInternalScript(); | 1007 bool isInternalScript = script->isInternalScript(); |
| 1015 bool isLiveEdit = script->isLiveEdit(); | 1008 bool isLiveEdit = script->isLiveEdit(); |
| 1016 bool hasSourceURL = script->hasSourceURL(); | 1009 bool hasSourceURL = script->hasSourceURL(); |
| 1017 String16 scriptId = script->scriptId(); | 1010 String16 scriptId = script->scriptId(); |
| 1018 String16 scriptURL = script->sourceURL(); | 1011 String16 scriptURL = script->sourceURL(); |
| 1019 bool deprecatedCommentWasUsed = isDeprecatedSourceURL || isDeprecatedSourceM appingURL; | |
| 1020 | 1012 |
| 1021 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); | 1013 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); |
| 1022 const Maybe<protocol::DictionaryValue>& executionContextAuxDataParam(std::mo ve(executionContextAuxData)); | 1014 const Maybe<protocol::DictionaryValue>& executionContextAuxDataParam(std::mo ve(executionContextAuxData)); |
| 1023 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n ullptr; | 1015 const bool* isInternalScriptParam = isInternalScript ? &isInternalScript : n ullptr; |
| 1024 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; | 1016 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; |
| 1025 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; | 1017 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; |
| 1026 const bool* deprecatedCommentWasUsedParam = deprecatedCommentWasUsed ? &depr ecatedCommentWasUsed : nullptr; | |
| 1027 if (success) | 1018 if (success) |
| 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 ); | 1019 m_frontend.scriptParsed(scriptId, scriptURL, script->startLine(), script ->startColumn(), script->endLine(), script->endColumn(), script->executionContex tId(), script->hash(), executionContextAuxDataParam, isInternalScriptParam, isLi veEditParam, sourceMapURLParam, hasSourceURLParam); |
| 1029 else | 1020 else |
| 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); | 1021 m_frontend.scriptFailedToParse(scriptId, scriptURL, script->startLine(), script->startColumn(), script->endLine(), script->endColumn(), script->executio nContextId(), script->hash(), executionContextAuxDataParam, isInternalScriptPara m, sourceMapURLParam, hasSourceURLParam); |
| 1031 | 1022 |
| 1032 m_scripts[scriptId] = std::move(script); | 1023 m_scripts[scriptId] = std::move(script); |
| 1033 | 1024 |
| 1034 if (scriptURL.isEmpty() || !success) | 1025 if (scriptURL.isEmpty() || !success) |
| 1035 return; | 1026 return; |
| 1036 | 1027 |
| 1037 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg entState::javaScriptBreakpoints); | 1028 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg entState::javaScriptBreakpoints); |
| 1038 if (!breakpointsCookie) | 1029 if (!breakpointsCookie) |
| 1039 return; | 1030 return; |
| 1040 | 1031 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1195 { | 1186 { |
| 1196 if (!enabled()) | 1187 if (!enabled()) |
| 1197 return; | 1188 return; |
| 1198 m_scheduledDebuggerStep = NoStep; | 1189 m_scheduledDebuggerStep = NoStep; |
| 1199 m_scripts.clear(); | 1190 m_scripts.clear(); |
| 1200 m_blackboxedPositions.clear(); | 1191 m_blackboxedPositions.clear(); |
| 1201 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1192 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1202 } | 1193 } |
| 1203 | 1194 |
| 1204 } // namespace blink | 1195 } // namespace blink |
| OLD | NEW |