| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 if (!m_inAsyncOperationForStepInto) | 1100 if (!m_inAsyncOperationForStepInto) |
| 1101 return; | 1101 return; |
| 1102 m_inAsyncOperationForStepInto = false; | 1102 m_inAsyncOperationForStepInto = false; |
| 1103 m_scheduledDebuggerStep = NoStep; | 1103 m_scheduledDebuggerStep = NoStep; |
| 1104 scriptDebugServer().setPauseOnNextStatement(false); | 1104 scriptDebugServer().setPauseOnNextStatement(false); |
| 1105 if (m_asyncOperationsForStepInto.isEmpty()) | 1105 if (m_asyncOperationsForStepInto.isEmpty()) |
| 1106 clearStepIntoAsync(); | 1106 clearStepIntoAsync(); |
| 1107 } | 1107 } |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 void InspectorDebuggerAgent::traceAsyncCallbackStarting(v8::Isolate* isolate, in
t operationId) | 1110 void InspectorDebuggerAgent::traceAsyncCallbackStarting(int operationId) |
| 1111 { | 1111 { |
| 1112 ASSERT(operationId > 0 || operationId == unknownAsyncOperationId); | 1112 ASSERT(operationId > 0 || operationId == unknownAsyncOperationId); |
| 1113 AsyncCallChain* chain = operationId > 0 ? m_asyncOperations.get(operationId)
: nullptr; | 1113 AsyncCallChain* chain = operationId > 0 ? m_asyncOperations.get(operationId)
: nullptr; |
| 1114 // FIXME: extract recursion check into a delegate. |
| 1115 v8::Isolate* isolate = scriptDebugServer().isolate(); |
| 1114 int recursionLevel = V8RecursionScope::recursionLevel(isolate); | 1116 int recursionLevel = V8RecursionScope::recursionLevel(isolate); |
| 1115 if (chain && (!recursionLevel || (recursionLevel == 1 && Microtask::performi
ngCheckpoint(isolate)))) { | 1117 if (chain && (!recursionLevel || (recursionLevel == 1 && Microtask::performi
ngCheckpoint(isolate)))) { |
| 1116 // Current AsyncCallChain corresponds to the bottommost JS call frame. | 1118 // Current AsyncCallChain corresponds to the bottommost JS call frame. |
| 1117 m_currentAsyncCallChain = chain; | 1119 m_currentAsyncCallChain = chain; |
| 1118 m_nestedAsyncCallCount = 1; | 1120 m_nestedAsyncCallCount = 1; |
| 1119 if (!m_performingAsyncStepIn) | 1121 if (!m_performingAsyncStepIn) |
| 1120 return; | 1122 return; |
| 1121 if (!m_asyncOperationsForStepInto.contains(operationId)) | 1123 if (!m_asyncOperationsForStepInto.contains(operationId)) |
| 1122 return; | 1124 return; |
| 1123 m_inAsyncOperationForStepInto = true; | 1125 m_inAsyncOperationForStepInto = true; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1140 m_asyncOperationsForStepInto.remove(operationId); | 1142 m_asyncOperationsForStepInto.remove(operationId); |
| 1141 if (!m_inAsyncOperationForStepInto && m_asyncOperationsForStepInto.isEmpty()
) | 1143 if (!m_inAsyncOperationForStepInto && m_asyncOperationsForStepInto.isEmpty()
) |
| 1142 clearStepIntoAsync(); | 1144 clearStepIntoAsync(); |
| 1143 } | 1145 } |
| 1144 | 1146 |
| 1145 void InspectorDebuggerAgent::resetAsyncCallTracker() | 1147 void InspectorDebuggerAgent::resetAsyncCallTracker() |
| 1146 { | 1148 { |
| 1147 m_currentAsyncCallChain.clear(); | 1149 m_currentAsyncCallChain.clear(); |
| 1148 m_nestedAsyncCallCount = 0; | 1150 m_nestedAsyncCallCount = 0; |
| 1149 for (auto& listener: m_asyncCallTrackingListeners) | 1151 for (auto& listener: m_asyncCallTrackingListeners) |
| 1150 listener->resetAsyncCallChains(); | 1152 listener->resetAsyncOperations(); |
| 1151 m_asyncOperations.clear(); | 1153 m_asyncOperations.clear(); |
| 1152 } | 1154 } |
| 1153 | 1155 |
| 1154 void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directive
Text) | 1156 void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directive
Text) |
| 1155 { | 1157 { |
| 1156 if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontP
auseOnExceptions) { | 1158 if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontP
auseOnExceptions) { |
| 1157 RefPtr<JSONObject> directive = JSONObject::create(); | 1159 RefPtr<JSONObject> directive = JSONObject::create(); |
| 1158 directive->setString("directiveText", directiveText); | 1160 directive->setString("directiveText", directiveText); |
| 1159 breakProgram(InspectorFrontend::Debugger::Reason::CSPViolation, directiv
e.release()); | 1161 breakProgram(InspectorFrontend::Debugger::Reason::CSPViolation, directiv
e.release()); |
| 1160 } | 1162 } |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1546 visitor->trace(m_v8AsyncCallTracker); | 1548 visitor->trace(m_v8AsyncCallTracker); |
| 1547 visitor->trace(m_promiseTracker); | 1549 visitor->trace(m_promiseTracker); |
| 1548 visitor->trace(m_asyncOperationsForStepInto); | 1550 visitor->trace(m_asyncOperationsForStepInto); |
| 1549 visitor->trace(m_currentAsyncCallChain); | 1551 visitor->trace(m_currentAsyncCallChain); |
| 1550 visitor->trace(m_asyncCallTrackingListeners); | 1552 visitor->trace(m_asyncCallTrackingListeners); |
| 1551 #endif | 1553 #endif |
| 1552 InspectorBaseAgent::trace(visitor); | 1554 InspectorBaseAgent::trace(visitor); |
| 1553 } | 1555 } |
| 1554 | 1556 |
| 1555 } // namespace blink | 1557 } // namespace blink |
| OLD | NEW |