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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 using WebCore::TypeBuilder::Array; | 54 using WebCore::TypeBuilder::Array; |
55 using WebCore::TypeBuilder::Debugger::BreakpointId; | 55 using WebCore::TypeBuilder::Debugger::BreakpointId; |
56 using WebCore::TypeBuilder::Debugger::CallFrame; | 56 using WebCore::TypeBuilder::Debugger::CallFrame; |
57 using WebCore::TypeBuilder::Debugger::ExceptionDetails; | 57 using WebCore::TypeBuilder::Debugger::ExceptionDetails; |
58 using WebCore::TypeBuilder::Debugger::FunctionDetails; | 58 using WebCore::TypeBuilder::Debugger::FunctionDetails; |
59 using WebCore::TypeBuilder::Debugger::ScriptId; | 59 using WebCore::TypeBuilder::Debugger::ScriptId; |
60 using WebCore::TypeBuilder::Debugger::StackTrace; | 60 using WebCore::TypeBuilder::Debugger::StackTrace; |
61 using WebCore::TypeBuilder::Runtime::RemoteObject; | 61 using WebCore::TypeBuilder::Runtime::RemoteObject; |
62 | 62 |
| 63 namespace { |
| 64 |
| 65 static const char v8AsyncTaskEventEnqueue[] = "enqueue"; |
| 66 static const char v8AsyncTaskEventWillHandle[] = "willHandle"; |
| 67 static const char v8AsyncTaskEventDidHandle[] = "didHandle"; |
| 68 |
| 69 } |
| 70 |
63 namespace WebCore { | 71 namespace WebCore { |
64 | 72 |
65 namespace DebuggerAgentState { | 73 namespace DebuggerAgentState { |
66 static const char debuggerEnabled[] = "debuggerEnabled"; | 74 static const char debuggerEnabled[] = "debuggerEnabled"; |
67 static const char javaScriptBreakpoints[] = "javaScriptBreakopints"; | 75 static const char javaScriptBreakpoints[] = "javaScriptBreakopints"; |
68 static const char pauseOnExceptionsState[] = "pauseOnExceptionsState"; | 76 static const char pauseOnExceptionsState[] = "pauseOnExceptionsState"; |
69 static const char asyncCallStackDepth[] = "asyncCallStackDepth"; | 77 static const char asyncCallStackDepth[] = "asyncCallStackDepth"; |
70 | 78 |
71 // Breakpoint properties. | 79 // Breakpoint properties. |
72 static const char url[] = "url"; | 80 static const char url[] = "url"; |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 if (m_asyncCallStackTracker.isEnabled()) | 835 if (m_asyncCallStackTracker.isEnabled()) |
828 m_asyncCallStackTracker.willPerformExecutionContextTask(context, task); | 836 m_asyncCallStackTracker.willPerformExecutionContextTask(context, task); |
829 } | 837 } |
830 | 838 |
831 void InspectorDebuggerAgent::didPerformExecutionContextTask() | 839 void InspectorDebuggerAgent::didPerformExecutionContextTask() |
832 { | 840 { |
833 if (m_asyncCallStackTracker.isEnabled()) | 841 if (m_asyncCallStackTracker.isEnabled()) |
834 m_asyncCallStackTracker.didFireAsyncCall(); | 842 m_asyncCallStackTracker.didFireAsyncCall(); |
835 } | 843 } |
836 | 844 |
| 845 void InspectorDebuggerAgent::didReceiveV8AsyncTaskEvent(ExecutionContext* contex
t, const String& eventType, const String& eventName, int id) |
| 846 { |
| 847 if (!m_asyncCallStackTracker.isEnabled()) |
| 848 return; |
| 849 if (eventType == v8AsyncTaskEventEnqueue) |
| 850 m_asyncCallStackTracker.didEnqueueV8AsyncTask(context, eventName, id, sc
riptDebugServer().currentCallFramesForAsyncStack()); |
| 851 else if (eventType == v8AsyncTaskEventWillHandle) |
| 852 m_asyncCallStackTracker.willHandleV8AsyncTask(context, eventName, id); |
| 853 else if (eventType == v8AsyncTaskEventDidHandle) |
| 854 m_asyncCallStackTracker.didFireAsyncCall(); |
| 855 else |
| 856 ASSERT_NOT_REACHED(); |
| 857 } |
| 858 |
837 void InspectorDebuggerAgent::pause(ErrorString*) | 859 void InspectorDebuggerAgent::pause(ErrorString*) |
838 { | 860 { |
839 if (m_javaScriptPauseScheduled || isPaused()) | 861 if (m_javaScriptPauseScheduled || isPaused()) |
840 return; | 862 return; |
841 clearBreakDetails(); | 863 clearBreakDetails(); |
842 m_javaScriptPauseScheduled = true; | 864 m_javaScriptPauseScheduled = true; |
843 scriptDebugServer().setPauseOnNextStatement(true); | 865 scriptDebugServer().setPauseOnNextStatement(true); |
844 } | 866 } |
845 | 867 |
846 void InspectorDebuggerAgent::resume(ErrorString* errorString) | 868 void InspectorDebuggerAgent::resume(ErrorString* errorString) |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 { | 1384 { |
1363 m_scripts.clear(); | 1385 m_scripts.clear(); |
1364 m_breakpointIdToDebugServerBreakpointIds.clear(); | 1386 m_breakpointIdToDebugServerBreakpointIds.clear(); |
1365 m_asyncCallStackTracker.clear(); | 1387 m_asyncCallStackTracker.clear(); |
1366 if (m_frontend) | 1388 if (m_frontend) |
1367 m_frontend->globalObjectCleared(); | 1389 m_frontend->globalObjectCleared(); |
1368 } | 1390 } |
1369 | 1391 |
1370 } // namespace WebCore | 1392 } // namespace WebCore |
1371 | 1393 |
OLD | NEW |