Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: Source/WebCore/inspector/InspectorDebuggerAgent.cpp

Issue 7708013: Merge 93042 - Web Inspector: [V8] crash upon stepIn while not on pause. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « Source/WebCore/inspector/InspectorDebuggerAgent.h ('k') | Source/WebCore/inspector/front-end/ScriptsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698