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

Unified Diff: Source/bindings/core/v8/ScriptDebugServer.cpp

Issue 651533003: DevTools: Introduce Debugger::Reason::PromiseRejection pause reason. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: also disaply <exception> in scopes sidebar Created 6 years, 2 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
« no previous file with comments | « Source/bindings/core/v8/ScriptDebugServer.h ('k') | Source/core/inspector/InspectorDebuggerAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptDebugServer.cpp
diff --git a/Source/bindings/core/v8/ScriptDebugServer.cpp b/Source/bindings/core/v8/ScriptDebugServer.cpp
index d4f4b6c70af005d5a3663cfcbf2b65394f4173c9..a5f873e0091ea2f97a0f9a9845a4862242abad8d 100644
--- a/Source/bindings/core/v8/ScriptDebugServer.cpp
+++ b/Source/bindings/core/v8/ScriptDebugServer.cpp
@@ -432,7 +432,7 @@ void ScriptDebugServer::breakProgramCallback(const v8::FunctionCallbackInfo<v8::
thisPtr->handleProgramBreak(pausedScriptState, v8::Handle<v8::Object>::Cast(info[0]), exception, hitBreakpoints);
}
-void ScriptDebugServer::handleProgramBreak(ScriptState* pausedScriptState, v8::Handle<v8::Object> executionState, v8::Handle<v8::Value> exception, v8::Handle<v8::Array> hitBreakpointNumbers)
+void ScriptDebugServer::handleProgramBreak(ScriptState* pausedScriptState, v8::Handle<v8::Object> executionState, v8::Handle<v8::Value> exception, v8::Handle<v8::Array> hitBreakpointNumbers, bool isPromiseRejection)
{
// Don't allow nested breaks.
if (m_runningNestedMessageLoop)
@@ -454,7 +454,7 @@ void ScriptDebugServer::handleProgramBreak(ScriptState* pausedScriptState, v8::H
m_pausedScriptState = pausedScriptState;
m_executionState = executionState;
- ScriptDebugListener::SkipPauseRequest result = listener->didPause(pausedScriptState, currentCallFrames(), ScriptValue(pausedScriptState, exception), breakpointIds);
+ ScriptDebugListener::SkipPauseRequest result = listener->didPause(pausedScriptState, currentCallFrames(), ScriptValue(pausedScriptState, exception), breakpointIds, isPromiseRejection);
if (result == ScriptDebugListener::NoSkip) {
m_runningNestedMessageLoop = true;
runMessageLoopOnPause(pausedScriptState->context());
@@ -516,7 +516,9 @@ void ScriptDebugServer::handleV8DebugEvent(const v8::Debug::EventDetails& eventD
} else if (event == v8::Exception) {
v8::Handle<v8::Object> eventData = eventDetails.GetEventData();
v8::Handle<v8::Value> exception = callInternalGetterFunction(eventData, "exception", m_isolate);
- handleProgramBreak(ScriptState::from(eventContext), eventDetails.GetExecutionState(), exception, v8::Handle<v8::Array>());
+ v8::Handle<v8::Value> promise = callInternalGetterFunction(eventData, "promise", m_isolate);
+ bool isPromiseRejection = !promise.IsEmpty() && promise->IsObject();
+ handleProgramBreak(ScriptState::from(eventContext), eventDetails.GetExecutionState(), exception, v8::Handle<v8::Array>(), isPromiseRejection);
} else if (event == v8::Break) {
v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() };
v8::Handle<v8::Value> hitBreakpoints = callDebuggerMethod("getBreakpointNumbers", 1, argv);
« no previous file with comments | « Source/bindings/core/v8/ScriptDebugServer.h ('k') | Source/core/inspector/InspectorDebuggerAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698