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

Side by Side Diff: Source/core/inspector/InspectorDebuggerAgent.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 ScriptBreakpoint breakpoint; 1380 ScriptBreakpoint breakpoint;
1381 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint. lineNumber); 1381 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint. lineNumber);
1382 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin t.columnNumber); 1382 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin t.columnNumber);
1383 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c ondition); 1383 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c ondition);
1384 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it- >key, scriptId, breakpoint, UserBreakpointSource); 1384 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it- >key, scriptId, breakpoint, UserBreakpointSource);
1385 if (location) 1385 if (location)
1386 m_frontend->breakpointResolved(it->key, location); 1386 m_frontend->breakpointResolved(it->key, location);
1387 } 1387 }
1388 } 1388 }
1389 1389
1390 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::didPause(ScriptSta te* scriptState, const ScriptValue& callFrames, const ScriptValue& exception, co nst Vector<String>& hitBreakpoints) 1390 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::didPause(ScriptSta te* scriptState, const ScriptValue& callFrames, const ScriptValue& exception, co nst Vector<String>& hitBreakpoints, bool isPromiseRejection)
1391 { 1391 {
1392 ScriptDebugListener::SkipPauseRequest result; 1392 ScriptDebugListener::SkipPauseRequest result;
1393 if (callFrames.isEmpty()) 1393 if (callFrames.isEmpty())
1394 result = ScriptDebugListener::Continue; // Skip pauses inside V8 interna l scripts and on syntax errors. 1394 result = ScriptDebugListener::Continue; // Skip pauses inside V8 interna l scripts and on syntax errors.
1395 else if (m_javaScriptPauseScheduled) 1395 else if (m_javaScriptPauseScheduled)
1396 result = ScriptDebugListener::NoSkip; // Don't skip explicit pause reque sts from front-end. 1396 result = ScriptDebugListener::NoSkip; // Don't skip explicit pause reque sts from front-end.
1397 else if (m_skipAllPauses) 1397 else if (m_skipAllPauses)
1398 result = ScriptDebugListener::Continue; 1398 result = ScriptDebugListener::Continue;
1399 else if (!hitBreakpoints.isEmpty()) 1399 else if (!hitBreakpoints.isEmpty())
1400 result = ScriptDebugListener::NoSkip; // Don't skip explicit breakpoints even if set in frameworks. 1400 result = ScriptDebugListener::NoSkip; // Don't skip explicit breakpoints even if set in frameworks.
1401 else if (!exception.isEmpty()) 1401 else if (!exception.isEmpty())
1402 result = shouldSkipExceptionPause(); 1402 result = shouldSkipExceptionPause();
1403 else if (m_debuggerStepScheduled || m_pausingOnNativeEvent) 1403 else if (m_debuggerStepScheduled || m_pausingOnNativeEvent)
1404 result = shouldSkipStepPause(); 1404 result = shouldSkipStepPause();
1405 else 1405 else
1406 result = ScriptDebugListener::NoSkip; 1406 result = ScriptDebugListener::NoSkip;
1407 1407
1408 if (result != ScriptDebugListener::NoSkip) 1408 if (result != ScriptDebugListener::NoSkip)
1409 return result; 1409 return result;
1410 1410
1411 ASSERT(scriptState && !m_pausedScriptState); 1411 ASSERT(scriptState && !m_pausedScriptState);
1412 m_pausedScriptState = scriptState; 1412 m_pausedScriptState = scriptState;
1413 m_currentCallStack = callFrames; 1413 m_currentCallStack = callFrames;
1414 1414
1415 if (!exception.isEmpty()) { 1415 if (!exception.isEmpty()) {
1416 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptF or(scriptState); 1416 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptF or(scriptState);
1417 if (!injectedScript.isEmpty()) { 1417 if (!injectedScript.isEmpty()) {
1418 m_breakReason = InspectorFrontend::Debugger::Reason::Exception; 1418 m_breakReason = isPromiseRejection ? InspectorFrontend::Debugger::Re ason::PromiseRejection : InspectorFrontend::Debugger::Reason::Exception;
1419 m_breakAuxData = injectedScript.wrapObject(exception, InspectorDebug gerAgent::backtraceObjectGroup)->openAccessors(); 1419 m_breakAuxData = injectedScript.wrapObject(exception, InspectorDebug gerAgent::backtraceObjectGroup)->openAccessors();
1420 // m_breakAuxData might be null after this. 1420 // m_breakAuxData might be null after this.
1421 } 1421 }
1422 } 1422 }
1423 1423
1424 RefPtr<Array<String> > hitBreakpointIds = Array<String>::create(); 1424 RefPtr<Array<String> > hitBreakpointIds = Array<String>::create();
1425 1425
1426 for (Vector<String>::const_iterator i = hitBreakpoints.begin(); i != hitBrea kpoints.end(); ++i) { 1426 for (Vector<String>::const_iterator i = hitBreakpoints.begin(); i != hitBrea kpoints.end(); ++i) {
1427 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator breakpointIter ator = m_serverBreakpoints.find(*i); 1427 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator breakpointIter ator = m_serverBreakpoints.find(*i);
1428 if (breakpointIterator != m_serverBreakpoints.end()) { 1428 if (breakpointIterator != m_serverBreakpoints.end()) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 visitor->trace(m_injectedScriptManager); 1536 visitor->trace(m_injectedScriptManager);
1537 visitor->trace(m_listener); 1537 visitor->trace(m_listener);
1538 visitor->trace(m_asyncCallStackTracker); 1538 visitor->trace(m_asyncCallStackTracker);
1539 #if ENABLE(OILPAN) 1539 #if ENABLE(OILPAN)
1540 visitor->trace(m_promiseTracker); 1540 visitor->trace(m_promiseTracker);
1541 #endif 1541 #endif
1542 InspectorBaseAgent::trace(visitor); 1542 InspectorBaseAgent::trace(visitor);
1543 } 1543 }
1544 1544
1545 } // namespace blink 1545 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/ScriptDebugListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698