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

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: Address review comments + track Promise result Created 6 years, 10 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 if (m_asyncCallStackTracker.isEnabled()) 790 if (m_asyncCallStackTracker.isEnabled())
791 m_asyncCallStackTracker.willPerformPromiseTask(context, task); 791 m_asyncCallStackTracker.willPerformPromiseTask(context, task);
792 } 792 }
793 793
794 void InspectorDebuggerAgent::didPerformPromiseTask() 794 void InspectorDebuggerAgent::didPerformPromiseTask()
795 { 795 {
796 if (m_asyncCallStackTracker.isEnabled()) 796 if (m_asyncCallStackTracker.isEnabled())
797 m_asyncCallStackTracker.didFireAsyncCall(); 797 m_asyncCallStackTracker.didFireAsyncCall();
798 } 798 }
799 799
800 void InspectorDebuggerAgent::addPromise(ExecutionContext* context, v8::Handle<v8 ::Object> promise, v8::Handle<v8::Object> parentPromise, V8PromiseCustom::Promis eState state) {
801 if (m_promiseOfficer.isEnabled()) {
aandrey 2014/02/26 16:11:30 drop curly braces. also below
Alexandra Mikhaylova 2014/02/28 13:52:05 Done.
802 m_promiseOfficer.addPromise(context, promise, parentPromise, state);
803 }
804 }
805
806 void InspectorDebuggerAgent::setPromiseParent(ExecutionContext* context, v8::Han dle<v8::Object> promise, v8::Handle<v8::Object> parentPromise) {
807 if (m_promiseOfficer.isEnabled()) {
808 m_promiseOfficer.setPromiseParent(context, promise, parentPromise);
809 }
810 }
811
812 void InspectorDebuggerAgent::setPromiseStateAndResult(ExecutionContext* context, v8::Handle<v8::Object> promise, v8::Handle<v8::Value> result, V8PromiseCustom:: PromiseState state) {
813 if (m_promiseOfficer.isEnabled()) {
814 m_promiseOfficer.setPromiseStateAndResult(context, promise, result, stat e);
815 }
816 }
817
800 void InspectorDebuggerAgent::pause(ErrorString*) 818 void InspectorDebuggerAgent::pause(ErrorString*)
801 { 819 {
802 if (m_javaScriptPauseScheduled) 820 if (m_javaScriptPauseScheduled)
803 return; 821 return;
804 clearBreakDetails(); 822 clearBreakDetails();
805 scriptDebugServer().setPauseOnNextStatement(true); 823 scriptDebugServer().setPauseOnNextStatement(true);
806 m_javaScriptPauseScheduled = true; 824 m_javaScriptPauseScheduled = true;
807 } 825 }
808 826
809 void InspectorDebuggerAgent::resume(ErrorString* errorString) 827 void InspectorDebuggerAgent::resume(ErrorString* errorString)
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 m_breakAuxData = data; 1233 m_breakAuxData = data;
1216 scriptDebugServer().breakProgram(); 1234 scriptDebugServer().breakProgram();
1217 } 1235 }
1218 1236
1219 void InspectorDebuggerAgent::clear() 1237 void InspectorDebuggerAgent::clear()
1220 { 1238 {
1221 m_pausedScriptState = 0; 1239 m_pausedScriptState = 0;
1222 m_currentCallStack = ScriptValue(); 1240 m_currentCallStack = ScriptValue();
1223 m_scripts.clear(); 1241 m_scripts.clear();
1224 m_breakpointIdToDebugServerBreakpointIds.clear(); 1242 m_breakpointIdToDebugServerBreakpointIds.clear();
1225 m_asyncCallStackTracker.clear(); 1243 m_asyncCallStackTracker.clear();
aandrey 2014/02/26 16:11:30 clear promise officer data here
Alexandra Mikhaylova 2014/02/28 13:52:05 Done.
1226 m_continueToLocationBreakpointId = String(); 1244 m_continueToLocationBreakpointId = String();
1227 clearBreakDetails(); 1245 clearBreakDetails();
1228 m_javaScriptPauseScheduled = false; 1246 m_javaScriptPauseScheduled = false;
1229 ErrorString error; 1247 ErrorString error;
1230 setOverlayMessage(&error, 0); 1248 setOverlayMessage(&error, 0);
1231 } 1249 }
1232 1250
1233 bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString) 1251 bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString)
1234 { 1252 {
1235 if (!m_pausedScriptState) { 1253 if (!m_pausedScriptState) {
(...skipping 18 matching lines...) Expand all
1254 1272
1255 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu mber, int columnNumber, BreakpointSource source) 1273 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu mber, int columnNumber, BreakpointSource source)
1256 { 1274 {
1257 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so urce)); 1275 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so urce));
1258 } 1276 }
1259 1277
1260 void InspectorDebuggerAgent::reset() 1278 void InspectorDebuggerAgent::reset()
1261 { 1279 {
1262 m_scripts.clear(); 1280 m_scripts.clear();
1263 m_breakpointIdToDebugServerBreakpointIds.clear(); 1281 m_breakpointIdToDebugServerBreakpointIds.clear();
1264 m_asyncCallStackTracker.clear(); 1282 m_asyncCallStackTracker.clear();
aandrey 2014/02/26 16:11:30 clear promise officer data here
Alexandra Mikhaylova 2014/02/28 13:52:05 Done.
1265 if (m_frontend) 1283 if (m_frontend)
1266 m_frontend->globalObjectCleared(); 1284 m_frontend->globalObjectCleared();
1267 } 1285 }
1268 1286
1269 } // namespace WebCore 1287 } // namespace WebCore
1270 1288
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698