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) 2010-2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2010-2011 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 using WebCore::TypeBuilder::Debugger::ScriptId; | 54 using WebCore::TypeBuilder::Debugger::ScriptId; |
55 using WebCore::TypeBuilder::Debugger::StackTrace; | 55 using WebCore::TypeBuilder::Debugger::StackTrace; |
56 using WebCore::TypeBuilder::Runtime::RemoteObject; | 56 using WebCore::TypeBuilder::Runtime::RemoteObject; |
57 | 57 |
58 namespace WebCore { | 58 namespace WebCore { |
59 | 59 |
60 namespace DebuggerAgentState { | 60 namespace DebuggerAgentState { |
61 static const char debuggerEnabled[] = "debuggerEnabled"; | 61 static const char debuggerEnabled[] = "debuggerEnabled"; |
62 static const char javaScriptBreakpoints[] = "javaScriptBreakopints"; | 62 static const char javaScriptBreakpoints[] = "javaScriptBreakopints"; |
63 static const char pauseOnExceptionsState[] = "pauseOnExceptionsState"; | 63 static const char pauseOnExceptionsState[] = "pauseOnExceptionsState"; |
| 64 static const char asyncCallStackDepth[] = "asyncCallStackDepth"; |
64 | 65 |
65 // Breakpoint properties. | 66 // Breakpoint properties. |
66 static const char url[] = "url"; | 67 static const char url[] = "url"; |
67 static const char isRegex[] = "isRegex"; | 68 static const char isRegex[] = "isRegex"; |
68 static const char lineNumber[] = "lineNumber"; | 69 static const char lineNumber[] = "lineNumber"; |
69 static const char columnNumber[] = "columnNumber"; | 70 static const char columnNumber[] = "columnNumber"; |
70 static const char condition[] = "condition"; | 71 static const char condition[] = "condition"; |
71 static const char isAnti[] = "isAnti"; | 72 static const char isAnti[] = "isAnti"; |
72 static const char skipStackPattern[] = "skipStackPattern"; | 73 static const char skipStackPattern[] = "skipStackPattern"; |
73 static const char skipAllPauses[] = "skipAllPauses"; | 74 static const char skipAllPauses[] = "skipAllPauses"; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 128 |
128 if (m_listener) | 129 if (m_listener) |
129 m_listener->debuggerWasEnabled(); | 130 m_listener->debuggerWasEnabled(); |
130 } | 131 } |
131 | 132 |
132 void InspectorDebuggerAgent::disable() | 133 void InspectorDebuggerAgent::disable() |
133 { | 134 { |
134 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, JSONObject::cr
eate()); | 135 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, JSONObject::cr
eate()); |
135 m_state->setLong(DebuggerAgentState::pauseOnExceptionsState, ScriptDebugServ
er::DontPauseOnExceptions); | 136 m_state->setLong(DebuggerAgentState::pauseOnExceptionsState, ScriptDebugServ
er::DontPauseOnExceptions); |
136 m_state->setString(DebuggerAgentState::skipStackPattern, ""); | 137 m_state->setString(DebuggerAgentState::skipStackPattern, ""); |
| 138 m_state->setLong(DebuggerAgentState::asyncCallStackDepth, 0); |
137 m_instrumentingAgents->setInspectorDebuggerAgent(0); | 139 m_instrumentingAgents->setInspectorDebuggerAgent(0); |
138 | 140 |
139 stopListeningScriptDebugServer(); | 141 stopListeningScriptDebugServer(); |
140 scriptDebugServer().clearBreakpoints(); | 142 scriptDebugServer().clearBreakpoints(); |
141 scriptDebugServer().clearCompiledScripts(); | 143 scriptDebugServer().clearCompiledScripts(); |
142 clear(); | 144 clear(); |
143 | 145 |
144 if (m_listener) | 146 if (m_listener) |
145 m_listener->debuggerWasDisabled(); | 147 m_listener->debuggerWasDisabled(); |
146 | 148 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 enable(); | 191 enable(); |
190 long pauseState = m_state->getLong(DebuggerAgentState::pauseOnExceptions
State); | 192 long pauseState = m_state->getLong(DebuggerAgentState::pauseOnExceptions
State); |
191 String error; | 193 String error; |
192 setPauseOnExceptionsImpl(&error, pauseState); | 194 setPauseOnExceptionsImpl(&error, pauseState); |
193 m_cachedSkipStackRegExp = compileSkipCallFramePattern(m_state->getString
(DebuggerAgentState::skipStackPattern)); | 195 m_cachedSkipStackRegExp = compileSkipCallFramePattern(m_state->getString
(DebuggerAgentState::skipStackPattern)); |
194 m_skipAllPauses = m_state->getBoolean(DebuggerAgentState::skipAllPauses)
; | 196 m_skipAllPauses = m_state->getBoolean(DebuggerAgentState::skipAllPauses)
; |
195 if (m_skipAllPauses && m_state->getBoolean(DebuggerAgentState::skipAllPa
usesExpiresOnReload)) { | 197 if (m_skipAllPauses && m_state->getBoolean(DebuggerAgentState::skipAllPa
usesExpiresOnReload)) { |
196 m_skipAllPauses = false; | 198 m_skipAllPauses = false; |
197 m_state->setBoolean(DebuggerAgentState::skipAllPauses, false); | 199 m_state->setBoolean(DebuggerAgentState::skipAllPauses, false); |
198 } | 200 } |
| 201 m_asyncCallStackTracker.setAsyncCallStackDepth(m_state->getLong(Debugger
AgentState::asyncCallStackDepth)); |
199 } | 202 } |
200 } | 203 } |
201 | 204 |
202 void InspectorDebuggerAgent::setFrontend(InspectorFrontend* frontend) | 205 void InspectorDebuggerAgent::setFrontend(InspectorFrontend* frontend) |
203 { | 206 { |
204 m_frontend = frontend->debugger(); | 207 m_frontend = frontend->debugger(); |
205 } | 208 } |
206 | 209 |
207 void InspectorDebuggerAgent::clearFrontend() | 210 void InspectorDebuggerAgent::clearFrontend() |
208 { | 211 { |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 *errorString = "Invalid regular expression"; | 927 *errorString = "Invalid regular expression"; |
925 return; | 928 return; |
926 } | 929 } |
927 } | 930 } |
928 m_state->setString(DebuggerAgentState::skipStackPattern, patternValue); | 931 m_state->setString(DebuggerAgentState::skipStackPattern, patternValue); |
929 m_cachedSkipStackRegExp = compiled.release(); | 932 m_cachedSkipStackRegExp = compiled.release(); |
930 } | 933 } |
931 | 934 |
932 void InspectorDebuggerAgent::setAsyncCallStackDepth(ErrorString*, int depth) | 935 void InspectorDebuggerAgent::setAsyncCallStackDepth(ErrorString*, int depth) |
933 { | 936 { |
| 937 m_state->setLong(DebuggerAgentState::asyncCallStackDepth, depth); |
934 m_asyncCallStackTracker.setAsyncCallStackDepth(depth); | 938 m_asyncCallStackTracker.setAsyncCallStackDepth(depth); |
935 } | 939 } |
936 | 940 |
937 void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directive
Text) | 941 void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directive
Text) |
938 { | 942 { |
939 if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontP
auseOnExceptions) { | 943 if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontP
auseOnExceptions) { |
940 RefPtr<JSONObject> directive = JSONObject::create(); | 944 RefPtr<JSONObject> directive = JSONObject::create(); |
941 directive->setString("directiveText", directiveText); | 945 directive->setString("directiveText", directiveText); |
942 breakProgram(InspectorFrontend::Debugger::Reason::CSPViolation, directiv
e.release()); | 946 breakProgram(InspectorFrontend::Debugger::Reason::CSPViolation, directiv
e.release()); |
943 } | 947 } |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 { | 1166 { |
1163 m_scripts.clear(); | 1167 m_scripts.clear(); |
1164 m_breakpointIdToDebugServerBreakpointIds.clear(); | 1168 m_breakpointIdToDebugServerBreakpointIds.clear(); |
1165 m_asyncCallStackTracker.clear(); | 1169 m_asyncCallStackTracker.clear(); |
1166 if (m_frontend) | 1170 if (m_frontend) |
1167 m_frontend->globalObjectCleared(); | 1171 m_frontend->globalObjectCleared(); |
1168 } | 1172 } |
1169 | 1173 |
1170 } // namespace WebCore | 1174 } // namespace WebCore |
1171 | 1175 |
OLD | NEW |