Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: src/inspector/v8-debugger-agent-impl.cc

Issue 2755863002: [Devtools] Add stacktrace to protocol for scriptParsed event (Closed)
Patch Set: [Devtools] Add stacktrace to protocol for scriptParsed event Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project 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 "src/inspector/v8-debugger-agent-impl.h" 5 #include "src/inspector/v8-debugger-agent-impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/debug/debug-interface.h" 9 #include "src/debug/debug-interface.h"
10 #include "src/inspector/injected-script.h" 10 #include "src/inspector/injected-script.h"
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 // make any change that change isFunctionBlackboxed output - adding parsed 1128 // make any change that change isFunctionBlackboxed output - adding parsed
1129 // script is changing. 1129 // script is changing.
1130 scriptRef->resetBlackboxedStateCache(); 1130 scriptRef->resetBlackboxedStateCache();
1131 1131
1132 Maybe<String16> sourceMapURLParam = scriptRef->sourceMappingURL(); 1132 Maybe<String16> sourceMapURLParam = scriptRef->sourceMappingURL();
1133 Maybe<protocol::DictionaryValue> executionContextAuxDataParam( 1133 Maybe<protocol::DictionaryValue> executionContextAuxDataParam(
1134 std::move(executionContextAuxData)); 1134 std::move(executionContextAuxData));
1135 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr; 1135 const bool* isLiveEditParam = isLiveEdit ? &isLiveEdit : nullptr;
1136 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr; 1136 const bool* hasSourceURLParam = hasSourceURL ? &hasSourceURL : nullptr;
1137 const bool* isModuleParam = isModule ? &isModule : nullptr; 1137 const bool* isModuleParam = isModule ? &isModule : nullptr;
1138 if (success) 1138 if (success) {
1139 std::unique_ptr<V8StackTraceImpl> stack =
1140 V8StackTraceImpl::capture(m_inspector->debugger(), contextGroupId,
dgozman 2017/03/16 18:39:03 Do we need the whole stack? Maybe just a top frame
allada 2017/03/16 21:02:12 Per our offline discussion, capturing 1 frame was
1141 V8StackTraceImpl::maxCallStackSizeToCapture);
1142 std::unique_ptr<protocol::Runtime::StackTrace> stackTrace =
1143 stack && !stack->isEmpty() ? stack->buildInspectorObjectImpl()
1144 : nullptr;
1139 m_frontend.scriptParsed( 1145 m_frontend.scriptParsed(
1140 scriptId, scriptURL, scriptRef->startLine(), scriptRef->startColumn(), 1146 scriptId, scriptURL, scriptRef->startLine(), scriptRef->startColumn(),
1141 scriptRef->endLine(), scriptRef->endColumn(), contextId, 1147 scriptRef->endLine(), scriptRef->endColumn(), contextId,
1142 scriptRef->hash(), std::move(executionContextAuxDataParam), 1148 scriptRef->hash(), std::move(executionContextAuxDataParam),
1143 isLiveEditParam, std::move(sourceMapURLParam), hasSourceURLParam, 1149 isLiveEditParam, std::move(sourceMapURLParam), hasSourceURLParam,
1144 isModuleParam, scriptRef->source().length()); 1150 isModuleParam, scriptRef->source().length(), std::move(stackTrace));
kozy 2017/03/16 18:35:12 let's do the same for scriptFailedToParse.
allada 2017/03/16 21:02:12 Done.
1145 else 1151 } else {
1146 m_frontend.scriptFailedToParse( 1152 m_frontend.scriptFailedToParse(
1147 scriptId, scriptURL, scriptRef->startLine(), scriptRef->startColumn(), 1153 scriptId, scriptURL, scriptRef->startLine(), scriptRef->startColumn(),
1148 scriptRef->endLine(), scriptRef->endColumn(), contextId, 1154 scriptRef->endLine(), scriptRef->endColumn(), contextId,
1149 scriptRef->hash(), std::move(executionContextAuxDataParam), 1155 scriptRef->hash(), std::move(executionContextAuxDataParam),
1150 std::move(sourceMapURLParam), hasSourceURLParam, isModuleParam, 1156 std::move(sourceMapURLParam), hasSourceURLParam, isModuleParam,
1151 scriptRef->source().length()); 1157 scriptRef->source().length());
dgozman 2017/03/16 18:39:04 It makes sense to send it for syntax errors as wel
allada 2017/03/16 21:02:12 Done.
1158 }
1152 1159
1153 if (scriptURL.isEmpty() || !success) return; 1160 if (scriptURL.isEmpty() || !success) return;
1154 1161
1155 protocol::DictionaryValue* breakpointsCookie = 1162 protocol::DictionaryValue* breakpointsCookie =
1156 m_state->getObject(DebuggerAgentState::javaScriptBreakpoints); 1163 m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
1157 if (!breakpointsCookie) return; 1164 if (!breakpointsCookie) return;
1158 1165
1159 for (size_t i = 0; i < breakpointsCookie->size(); ++i) { 1166 for (size_t i = 0; i < breakpointsCookie->size(); ++i) {
1160 auto cookie = breakpointsCookie->at(i); 1167 auto cookie = breakpointsCookie->at(i);
1161 protocol::DictionaryValue* breakpointObject = 1168 protocol::DictionaryValue* breakpointObject =
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 void V8DebuggerAgentImpl::reset() { 1350 void V8DebuggerAgentImpl::reset() {
1344 if (!enabled()) return; 1351 if (!enabled()) return;
1345 m_scheduledDebuggerStep = NoStep; 1352 m_scheduledDebuggerStep = NoStep;
1346 m_blackboxedPositions.clear(); 1353 m_blackboxedPositions.clear();
1347 resetBlackboxedStateCache(); 1354 resetBlackboxedStateCache();
1348 m_scripts.clear(); 1355 m_scripts.clear();
1349 m_breakpointIdToDebuggerBreakpointIds.clear(); 1356 m_breakpointIdToDebuggerBreakpointIds.clear();
1350 } 1357 }
1351 1358
1352 } // namespace v8_inspector 1359 } // namespace v8_inspector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698