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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 if (eventType == v8AsyncTaskEventEnqueue) | 874 if (eventType == v8AsyncTaskEventEnqueue) |
875 m_asyncCallStackTracker.didEnqueueV8AsyncTask(context, eventName, id, sc
riptDebugServer().currentCallFramesForAsyncStack()); | 875 m_asyncCallStackTracker.didEnqueueV8AsyncTask(context, eventName, id, sc
riptDebugServer().currentCallFramesForAsyncStack()); |
876 else if (eventType == v8AsyncTaskEventWillHandle) | 876 else if (eventType == v8AsyncTaskEventWillHandle) |
877 m_asyncCallStackTracker.willHandleV8AsyncTask(context, eventName, id); | 877 m_asyncCallStackTracker.willHandleV8AsyncTask(context, eventName, id); |
878 else if (eventType == v8AsyncTaskEventDidHandle) | 878 else if (eventType == v8AsyncTaskEventDidHandle) |
879 m_asyncCallStackTracker.didFireAsyncCall(); | 879 m_asyncCallStackTracker.didFireAsyncCall(); |
880 else | 880 else |
881 ASSERT_NOT_REACHED(); | 881 ASSERT_NOT_REACHED(); |
882 } | 882 } |
883 | 883 |
| 884 void InspectorDebuggerAgent::didReceiveV8NewPromiseEvent(ExecutionContext* conte
xt, v8::Handle<v8::Object> promise) |
| 885 { |
| 886 if (!m_promiseTracker.isEnabled()) |
| 887 return; |
| 888 m_promiseTracker.didCreatePromise(context, promise); |
| 889 } |
| 890 |
| 891 void InspectorDebuggerAgent::didReceiveV8UpdatePromiseEvent(ExecutionContext* co
ntext, v8::Handle<v8::Object> promise, int status, v8::Handle<v8::Value> value) |
| 892 { |
| 893 if (!m_promiseTracker.isEnabled()) |
| 894 return; |
| 895 m_promiseTracker.didUpdatePromiseStatus(context, promise, status, value); |
| 896 } |
| 897 |
| 898 void InspectorDebuggerAgent::didReceiveV8ChainPromiseEvent(ExecutionContext* con
text, v8::Handle<v8::Object> promise, v8::Handle<v8::Object> parentPromise) |
| 899 { |
| 900 if (!m_promiseTracker.isEnabled()) |
| 901 return; |
| 902 m_promiseTracker.didUpdatePromiseParent(context, promise, parentPromise); |
| 903 } |
| 904 |
884 void InspectorDebuggerAgent::pause(ErrorString*) | 905 void InspectorDebuggerAgent::pause(ErrorString*) |
885 { | 906 { |
886 if (m_javaScriptPauseScheduled || isPaused()) | 907 if (m_javaScriptPauseScheduled || isPaused()) |
887 return; | 908 return; |
888 clearBreakDetails(); | 909 clearBreakDetails(); |
889 m_javaScriptPauseScheduled = true; | 910 m_javaScriptPauseScheduled = true; |
890 scriptDebugServer().setPauseOnNextStatement(true); | 911 scriptDebugServer().setPauseOnNextStatement(true); |
891 } | 912 } |
892 | 913 |
893 void InspectorDebuggerAgent::resume(ErrorString* errorString) | 914 void InspectorDebuggerAgent::resume(ErrorString* errorString) |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1377 scriptDebugServer().breakProgram(); | 1398 scriptDebugServer().breakProgram(); |
1378 } | 1399 } |
1379 | 1400 |
1380 void InspectorDebuggerAgent::clear() | 1401 void InspectorDebuggerAgent::clear() |
1381 { | 1402 { |
1382 m_pausedScriptState = nullptr; | 1403 m_pausedScriptState = nullptr; |
1383 m_currentCallStack = ScriptValue(); | 1404 m_currentCallStack = ScriptValue(); |
1384 m_scripts.clear(); | 1405 m_scripts.clear(); |
1385 m_breakpointIdToDebugServerBreakpointIds.clear(); | 1406 m_breakpointIdToDebugServerBreakpointIds.clear(); |
1386 m_asyncCallStackTracker.clear(); | 1407 m_asyncCallStackTracker.clear(); |
| 1408 m_promiseTracker.clear(); |
1387 m_continueToLocationBreakpointId = String(); | 1409 m_continueToLocationBreakpointId = String(); |
1388 clearBreakDetails(); | 1410 clearBreakDetails(); |
1389 m_javaScriptPauseScheduled = false; | 1411 m_javaScriptPauseScheduled = false; |
1390 m_debuggerStepScheduled = false; | 1412 m_debuggerStepScheduled = false; |
1391 m_steppingFromFramework = false; | 1413 m_steppingFromFramework = false; |
1392 m_pausingOnNativeEvent = false; | 1414 m_pausingOnNativeEvent = false; |
1393 ErrorString error; | 1415 ErrorString error; |
1394 setOverlayMessage(&error, 0); | 1416 setOverlayMessage(&error, 0); |
1395 } | 1417 } |
1396 | 1418 |
(...skipping 22 matching lines...) Expand all Loading... |
1419 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu
mber, int columnNumber, BreakpointSource source) | 1441 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu
mber, int columnNumber, BreakpointSource source) |
1420 { | 1442 { |
1421 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so
urce)); | 1443 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so
urce)); |
1422 } | 1444 } |
1423 | 1445 |
1424 void InspectorDebuggerAgent::reset() | 1446 void InspectorDebuggerAgent::reset() |
1425 { | 1447 { |
1426 m_scripts.clear(); | 1448 m_scripts.clear(); |
1427 m_breakpointIdToDebugServerBreakpointIds.clear(); | 1449 m_breakpointIdToDebugServerBreakpointIds.clear(); |
1428 m_asyncCallStackTracker.clear(); | 1450 m_asyncCallStackTracker.clear(); |
| 1451 m_promiseTracker.clear(); |
1429 if (m_frontend) | 1452 if (m_frontend) |
1430 m_frontend->globalObjectCleared(); | 1453 m_frontend->globalObjectCleared(); |
1431 } | 1454 } |
1432 | 1455 |
1433 void InspectorDebuggerAgent::trace(Visitor* visitor) | 1456 void InspectorDebuggerAgent::trace(Visitor* visitor) |
1434 { | 1457 { |
1435 visitor->trace(m_injectedScriptManager); | 1458 visitor->trace(m_injectedScriptManager); |
1436 visitor->trace(m_listener); | 1459 visitor->trace(m_listener); |
1437 InspectorBaseAgent::trace(visitor); | 1460 InspectorBaseAgent::trace(visitor); |
1438 } | 1461 } |
1439 | 1462 |
1440 } // namespace blink | 1463 } // namespace blink |
1441 | 1464 |
OLD | NEW |