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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 using WebCore::TypeBuilder::Array; | 53 using WebCore::TypeBuilder::Array; |
54 using WebCore::TypeBuilder::Debugger::BreakpointId; | 54 using WebCore::TypeBuilder::Debugger::BreakpointId; |
55 using WebCore::TypeBuilder::Debugger::CallFrame; | 55 using WebCore::TypeBuilder::Debugger::CallFrame; |
56 using WebCore::TypeBuilder::Debugger::ExceptionDetails; | 56 using WebCore::TypeBuilder::Debugger::ExceptionDetails; |
57 using WebCore::TypeBuilder::Debugger::FunctionDetails; | 57 using WebCore::TypeBuilder::Debugger::FunctionDetails; |
58 using WebCore::TypeBuilder::Debugger::ScriptId; | 58 using WebCore::TypeBuilder::Debugger::ScriptId; |
59 using WebCore::TypeBuilder::Debugger::StackTrace; | 59 using WebCore::TypeBuilder::Debugger::StackTrace; |
60 using WebCore::TypeBuilder::Runtime::RemoteObject; | 60 using WebCore::TypeBuilder::Runtime::RemoteObject; |
61 | 61 |
| 62 namespace { |
| 63 |
| 64 static const char v8AsyncTaskEventEnqueue[] = "enqueue"; |
| 65 static const char v8AsyncTaskEventWillHandle[] = "willHandle"; |
| 66 static const char v8AsyncTaskEventDidHandle[] = "didHandle"; |
| 67 |
| 68 } |
| 69 |
62 namespace WebCore { | 70 namespace WebCore { |
63 | 71 |
64 namespace DebuggerAgentState { | 72 namespace DebuggerAgentState { |
65 static const char debuggerEnabled[] = "debuggerEnabled"; | 73 static const char debuggerEnabled[] = "debuggerEnabled"; |
66 static const char javaScriptBreakpoints[] = "javaScriptBreakopints"; | 74 static const char javaScriptBreakpoints[] = "javaScriptBreakopints"; |
67 static const char pauseOnExceptionsState[] = "pauseOnExceptionsState"; | 75 static const char pauseOnExceptionsState[] = "pauseOnExceptionsState"; |
68 static const char asyncCallStackDepth[] = "asyncCallStackDepth"; | 76 static const char asyncCallStackDepth[] = "asyncCallStackDepth"; |
69 | 77 |
70 // Breakpoint properties. | 78 // Breakpoint properties. |
71 static const char url[] = "url"; | 79 static const char url[] = "url"; |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 if (m_asyncCallStackTracker.isEnabled()) | 810 if (m_asyncCallStackTracker.isEnabled()) |
803 m_asyncCallStackTracker.willDeliverMutationRecords(context, observer); | 811 m_asyncCallStackTracker.willDeliverMutationRecords(context, observer); |
804 } | 812 } |
805 | 813 |
806 void InspectorDebuggerAgent::didDeliverMutationRecords() | 814 void InspectorDebuggerAgent::didDeliverMutationRecords() |
807 { | 815 { |
808 if (m_asyncCallStackTracker.isEnabled()) | 816 if (m_asyncCallStackTracker.isEnabled()) |
809 m_asyncCallStackTracker.didFireAsyncCall(); | 817 m_asyncCallStackTracker.didFireAsyncCall(); |
810 } | 818 } |
811 | 819 |
| 820 void InspectorDebuggerAgent::didReceiveV8AsyncTaskEvent(ExecutionContext* contex
t, const String& eventType, const String& eventName, int id) |
| 821 { |
| 822 if (!m_asyncCallStackTracker.isEnabled()) |
| 823 return; |
| 824 if (eventType == v8AsyncTaskEventEnqueue) |
| 825 m_asyncCallStackTracker.didEnqueueV8AsyncTask(context, eventName, id, sc
riptDebugServer().currentCallFramesForAsyncStack()); |
| 826 else if (eventType == v8AsyncTaskEventWillHandle) |
| 827 m_asyncCallStackTracker.willHandleV8AsyncTask(context, eventName, id); |
| 828 else if (eventType == v8AsyncTaskEventDidHandle) |
| 829 m_asyncCallStackTracker.didFireAsyncCall(); |
| 830 else |
| 831 ASSERT_NOT_REACHED(); |
| 832 } |
| 833 |
812 void InspectorDebuggerAgent::pause(ErrorString*) | 834 void InspectorDebuggerAgent::pause(ErrorString*) |
813 { | 835 { |
814 if (m_javaScriptPauseScheduled || isPaused()) | 836 if (m_javaScriptPauseScheduled || isPaused()) |
815 return; | 837 return; |
816 clearBreakDetails(); | 838 clearBreakDetails(); |
817 m_javaScriptPauseScheduled = true; | 839 m_javaScriptPauseScheduled = true; |
818 scriptDebugServer().setPauseOnNextStatement(true); | 840 scriptDebugServer().setPauseOnNextStatement(true); |
819 } | 841 } |
820 | 842 |
821 void InspectorDebuggerAgent::resume(ErrorString* errorString) | 843 void InspectorDebuggerAgent::resume(ErrorString* errorString) |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 { | 1359 { |
1338 m_scripts.clear(); | 1360 m_scripts.clear(); |
1339 m_breakpointIdToDebugServerBreakpointIds.clear(); | 1361 m_breakpointIdToDebugServerBreakpointIds.clear(); |
1340 m_asyncCallStackTracker.clear(); | 1362 m_asyncCallStackTracker.clear(); |
1341 if (m_frontend) | 1363 if (m_frontend) |
1342 m_frontend->globalObjectCleared(); | 1364 m_frontend->globalObjectCleared(); |
1343 } | 1365 } |
1344 | 1366 |
1345 } // namespace WebCore | 1367 } // namespace WebCore |
1346 | 1368 |
OLD | NEW |