Index: Source/WebCore/inspector/InspectorDebuggerAgent.cpp |
=================================================================== |
--- Source/WebCore/inspector/InspectorDebuggerAgent.cpp (revision 93524) |
+++ Source/WebCore/inspector/InspectorDebuggerAgent.cpp (working copy) |
@@ -350,24 +350,32 @@ |
m_javaScriptPauseScheduled = true; |
} |
-void InspectorDebuggerAgent::resume(ErrorString*) |
+void InspectorDebuggerAgent::resume(ErrorString* errorString) |
{ |
+ if (!assertPaused(errorString)) |
+ return; |
m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup); |
scriptDebugServer().continueProgram(); |
} |
-void InspectorDebuggerAgent::stepOver(ErrorString*) |
+void InspectorDebuggerAgent::stepOver(ErrorString* errorString) |
{ |
+ if (!assertPaused(errorString)) |
+ return; |
scriptDebugServer().stepOverStatement(); |
} |
-void InspectorDebuggerAgent::stepInto(ErrorString*) |
+void InspectorDebuggerAgent::stepInto(ErrorString* errorString) |
{ |
+ if (!assertPaused(errorString)) |
+ return; |
scriptDebugServer().stepIntoStatement(); |
} |
-void InspectorDebuggerAgent::stepOut(ErrorString*) |
+void InspectorDebuggerAgent::stepOut(ErrorString* errorString) |
{ |
+ if (!assertPaused(errorString)) |
+ return; |
scriptDebugServer().stepOutOfFunction(); |
} |
@@ -499,6 +507,15 @@ |
m_javaScriptPauseScheduled = false; |
} |
+bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString) |
+{ |
+ if (!m_pausedScriptState) { |
+ *errorString = "Can only perform operation while paused."; |
+ return false; |
+ } |
+ return true; |
+} |
+ |
} // namespace WebCore |
#endif // ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR) |