| 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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 866 |
| 867 m_blackboxedPositions[scriptId] = positions; | 867 m_blackboxedPositions[scriptId] = positions; |
| 868 } | 868 } |
| 869 | 869 |
| 870 void V8DebuggerAgentImpl::willExecuteScript(int scriptId) | 870 void V8DebuggerAgentImpl::willExecuteScript(int scriptId) |
| 871 { | 871 { |
| 872 changeJavaScriptRecursionLevel(+1); | 872 changeJavaScriptRecursionLevel(+1); |
| 873 // Fast return. | 873 // Fast return. |
| 874 if (m_scheduledDebuggerStep != StepInto) | 874 if (m_scheduledDebuggerStep != StepInto) |
| 875 return; | 875 return; |
| 876 // Skip unknown scripts (e.g. InjectedScript). | |
| 877 if (m_scripts.find(String16::fromInteger(scriptId)) == m_scripts.end()) | |
| 878 return; | |
| 879 schedulePauseOnNextStatementIfSteppingInto(); | 876 schedulePauseOnNextStatementIfSteppingInto(); |
| 880 } | 877 } |
| 881 | 878 |
| 882 void V8DebuggerAgentImpl::didExecuteScript() | 879 void V8DebuggerAgentImpl::didExecuteScript() |
| 883 { | 880 { |
| 884 changeJavaScriptRecursionLevel(-1); | 881 changeJavaScriptRecursionLevel(-1); |
| 885 } | 882 } |
| 886 | 883 |
| 887 void V8DebuggerAgentImpl::changeJavaScriptRecursionLevel(int step) | 884 void V8DebuggerAgentImpl::changeJavaScriptRecursionLevel(int step) |
| 888 { | 885 { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 if (location) | 1044 if (location) |
| 1048 m_frontend.breakpointResolved(cookie.first, std::move(location)); | 1045 m_frontend.breakpointResolved(cookie.first, std::move(location)); |
| 1049 } | 1046 } |
| 1050 } | 1047 } |
| 1051 | 1048 |
| 1052 V8DebuggerAgentImpl::SkipPauseRequest V8DebuggerAgentImpl::didPause(v8::Local<v8
::Context> context, v8::Local<v8::Value> exception, const std::vector<String16>&
hitBreakpoints, bool isPromiseRejection) | 1049 V8DebuggerAgentImpl::SkipPauseRequest V8DebuggerAgentImpl::didPause(v8::Local<v8
::Context> context, v8::Local<v8::Value> exception, const std::vector<String16>&
hitBreakpoints, bool isPromiseRejection) |
| 1053 { | 1050 { |
| 1054 JavaScriptCallFrames callFrames = debugger().currentCallFrames(1); | 1051 JavaScriptCallFrames callFrames = debugger().currentCallFrames(1); |
| 1055 JavaScriptCallFrame* topCallFrame = !callFrames.empty() ? callFrames.begin()
->get() : nullptr; | 1052 JavaScriptCallFrame* topCallFrame = !callFrames.empty() ? callFrames.begin()
->get() : nullptr; |
| 1056 | 1053 |
| 1054 // Skip pause in internal scripts (e.g. InjectedScriptSource.js). |
| 1055 if (topCallFrame) { |
| 1056 ScriptsMap::iterator it = m_scripts.find(String16::fromInteger(topCallFr
ame->sourceID())); |
| 1057 if (it != m_scripts.end() && it->second->isInternalScript()) |
| 1058 return RequestStepFrame; |
| 1059 } |
| 1060 |
| 1057 V8DebuggerAgentImpl::SkipPauseRequest result; | 1061 V8DebuggerAgentImpl::SkipPauseRequest result; |
| 1058 if (m_skipAllPauses) | 1062 if (m_skipAllPauses) |
| 1059 result = RequestContinue; | 1063 result = RequestContinue; |
| 1060 else if (!hitBreakpoints.empty()) | 1064 else if (!hitBreakpoints.empty()) |
| 1061 result = RequestNoSkip; // Don't skip explicit breakpoints even if set i
n frameworks. | 1065 result = RequestNoSkip; // Don't skip explicit breakpoints even if set i
n frameworks. |
| 1062 else if (!exception.IsEmpty()) | 1066 else if (!exception.IsEmpty()) |
| 1063 result = shouldSkipExceptionPause(topCallFrame); | 1067 result = shouldSkipExceptionPause(topCallFrame); |
| 1064 else if (m_scheduledDebuggerStep != NoStep || m_javaScriptPauseScheduled ||
m_pausingOnNativeEvent) | 1068 else if (m_scheduledDebuggerStep != NoStep || m_javaScriptPauseScheduled ||
m_pausingOnNativeEvent) |
| 1065 result = shouldSkipStepPause(topCallFrame); | 1069 result = shouldSkipStepPause(topCallFrame); |
| 1066 else | 1070 else |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 { | 1184 { |
| 1181 if (!enabled()) | 1185 if (!enabled()) |
| 1182 return; | 1186 return; |
| 1183 m_scheduledDebuggerStep = NoStep; | 1187 m_scheduledDebuggerStep = NoStep; |
| 1184 m_scripts.clear(); | 1188 m_scripts.clear(); |
| 1185 m_blackboxedPositions.clear(); | 1189 m_blackboxedPositions.clear(); |
| 1186 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1190 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1187 } | 1191 } |
| 1188 | 1192 |
| 1189 } // namespace blink | 1193 } // namespace blink |
| OLD | NEW |