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

Side by Side Diff: Source/core/inspector/InspectorDebuggerAgent.cpp

Issue 177773002: Support Promises instrumentation on backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: V8PromiseCustom::setState -> (anonymous namespace)::setStateForPromise + REBASE Created 6 years, 9 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
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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 if (m_asyncCallStackTracker.isEnabled()) 791 if (m_asyncCallStackTracker.isEnabled())
792 m_asyncCallStackTracker.willPerformPromiseTask(context, task); 792 m_asyncCallStackTracker.willPerformPromiseTask(context, task);
793 } 793 }
794 794
795 void InspectorDebuggerAgent::didPerformPromiseTask() 795 void InspectorDebuggerAgent::didPerformPromiseTask()
796 { 796 {
797 if (m_asyncCallStackTracker.isEnabled()) 797 if (m_asyncCallStackTracker.isEnabled())
798 m_asyncCallStackTracker.didFireAsyncCall(); 798 m_asyncCallStackTracker.didFireAsyncCall();
799 } 799 }
800 800
801 bool InspectorDebuggerAgent::isPromiseTrackerEnabled()
802 {
803 return m_promiseTracker.isEnabled();
804 }
805
806 void InspectorDebuggerAgent::didCreatePromise(const ScriptObject& promise)
807 {
808 if (m_promiseTracker.isEnabled())
809 m_promiseTracker.didCreatePromise(promise);
810 }
811
812 void InspectorDebuggerAgent::didUpdatePromiseParent(const ScriptObject& promise, const ScriptObject& parentPromise)
813 {
814 if (m_promiseTracker.isEnabled())
815 m_promiseTracker.didUpdatePromiseParent(promise, parentPromise);
816 }
817
818 void InspectorDebuggerAgent::didUpdatePromiseState(const ScriptObject& promise, V8PromiseCustom::PromiseState state, const ScriptValue& result)
819 {
820 if (m_promiseTracker.isEnabled())
821 m_promiseTracker.didUpdatePromiseState(promise, state, result);
822 }
823
801 void InspectorDebuggerAgent::pause(ErrorString*) 824 void InspectorDebuggerAgent::pause(ErrorString*)
802 { 825 {
803 if (m_javaScriptPauseScheduled) 826 if (m_javaScriptPauseScheduled)
804 return; 827 return;
805 clearBreakDetails(); 828 clearBreakDetails();
806 scriptDebugServer().setPauseOnNextStatement(true); 829 scriptDebugServer().setPauseOnNextStatement(true);
807 m_javaScriptPauseScheduled = true; 830 m_javaScriptPauseScheduled = true;
808 } 831 }
809 832
810 void InspectorDebuggerAgent::resume(ErrorString* errorString) 833 void InspectorDebuggerAgent::resume(ErrorString* errorString)
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 scriptDebugServer().breakProgram(); 1240 scriptDebugServer().breakProgram();
1218 } 1241 }
1219 1242
1220 void InspectorDebuggerAgent::clear() 1243 void InspectorDebuggerAgent::clear()
1221 { 1244 {
1222 m_pausedScriptState = 0; 1245 m_pausedScriptState = 0;
1223 m_currentCallStack = ScriptValue(); 1246 m_currentCallStack = ScriptValue();
1224 m_scripts.clear(); 1247 m_scripts.clear();
1225 m_breakpointIdToDebugServerBreakpointIds.clear(); 1248 m_breakpointIdToDebugServerBreakpointIds.clear();
1226 m_asyncCallStackTracker.clear(); 1249 m_asyncCallStackTracker.clear();
1250 m_promiseTracker.clear();
1227 m_continueToLocationBreakpointId = String(); 1251 m_continueToLocationBreakpointId = String();
1228 clearBreakDetails(); 1252 clearBreakDetails();
1229 m_javaScriptPauseScheduled = false; 1253 m_javaScriptPauseScheduled = false;
1230 ErrorString error; 1254 ErrorString error;
1231 setOverlayMessage(&error, 0); 1255 setOverlayMessage(&error, 0);
1232 } 1256 }
1233 1257
1234 bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString) 1258 bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString)
1235 { 1259 {
1236 if (!m_pausedScriptState) { 1260 if (!m_pausedScriptState) {
(...skipping 19 matching lines...) Expand all
1256 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu mber, int columnNumber, BreakpointSource source) 1280 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu mber, int columnNumber, BreakpointSource source)
1257 { 1281 {
1258 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so urce)); 1282 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so urce));
1259 } 1283 }
1260 1284
1261 void InspectorDebuggerAgent::reset() 1285 void InspectorDebuggerAgent::reset()
1262 { 1286 {
1263 m_scripts.clear(); 1287 m_scripts.clear();
1264 m_breakpointIdToDebugServerBreakpointIds.clear(); 1288 m_breakpointIdToDebugServerBreakpointIds.clear();
1265 m_asyncCallStackTracker.clear(); 1289 m_asyncCallStackTracker.clear();
1290 m_promiseTracker.clear();
1266 if (m_frontend) 1291 if (m_frontend)
1267 m_frontend->globalObjectCleared(); 1292 m_frontend->globalObjectCleared();
1268 } 1293 }
1269 1294
1270 } // namespace WebCore 1295 } // namespace WebCore
1271 1296
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDebuggerAgent.h ('k') | Source/core/inspector/InspectorInstrumentation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698