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

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: Fix style 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 void InspectorDebuggerAgent::didCreatePromise(ExecutionContext* context, v8::Han dle<v8::Object> promise, v8::Handle<v8::Object> parentPromise, V8PromiseCustom:: PromiseState state)
802 {
803 if (m_promiseOfficer.isEnabled())
804 m_promiseOfficer.didCreatePromise(context, promise, parentPromise, state );
805 }
806
807 void InspectorDebuggerAgent::didUpdatePromiseParent(v8::Handle<v8::Object> promi se, v8::Handle<v8::Object> parentPromise)
808 {
809 if (m_promiseOfficer.isEnabled())
810 m_promiseOfficer.didUpdatePromiseParent(promise, parentPromise);
811 }
812
813 void InspectorDebuggerAgent::didUpdatePromiseState(v8::Handle<v8::Object> promis e, V8PromiseCustom::PromiseState state, v8::Handle<v8::Value> result)
814 {
815 if (m_promiseOfficer.isEnabled())
816 m_promiseOfficer.didUpdatePromiseState(promise, state, result);
817 }
818
801 void InspectorDebuggerAgent::pause(ErrorString*) 819 void InspectorDebuggerAgent::pause(ErrorString*)
802 { 820 {
803 if (m_javaScriptPauseScheduled) 821 if (m_javaScriptPauseScheduled)
804 return; 822 return;
805 clearBreakDetails(); 823 clearBreakDetails();
806 scriptDebugServer().setPauseOnNextStatement(true); 824 scriptDebugServer().setPauseOnNextStatement(true);
807 m_javaScriptPauseScheduled = true; 825 m_javaScriptPauseScheduled = true;
808 } 826 }
809 827
810 void InspectorDebuggerAgent::resume(ErrorString* errorString) 828 void InspectorDebuggerAgent::resume(ErrorString* errorString)
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 scriptDebugServer().breakProgram(); 1235 scriptDebugServer().breakProgram();
1218 } 1236 }
1219 1237
1220 void InspectorDebuggerAgent::clear() 1238 void InspectorDebuggerAgent::clear()
1221 { 1239 {
1222 m_pausedScriptState = 0; 1240 m_pausedScriptState = 0;
1223 m_currentCallStack = ScriptValue(); 1241 m_currentCallStack = ScriptValue();
1224 m_scripts.clear(); 1242 m_scripts.clear();
1225 m_breakpointIdToDebugServerBreakpointIds.clear(); 1243 m_breakpointIdToDebugServerBreakpointIds.clear();
1226 m_asyncCallStackTracker.clear(); 1244 m_asyncCallStackTracker.clear();
1245 m_promiseOfficer.clear();
1227 m_continueToLocationBreakpointId = String(); 1246 m_continueToLocationBreakpointId = String();
1228 clearBreakDetails(); 1247 clearBreakDetails();
1229 m_javaScriptPauseScheduled = false; 1248 m_javaScriptPauseScheduled = false;
1230 ErrorString error; 1249 ErrorString error;
1231 setOverlayMessage(&error, 0); 1250 setOverlayMessage(&error, 0);
1232 } 1251 }
1233 1252
1234 bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString) 1253 bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString)
1235 { 1254 {
1236 if (!m_pausedScriptState) { 1255 if (!m_pausedScriptState) {
(...skipping 19 matching lines...) Expand all
1256 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu mber, int columnNumber, BreakpointSource source) 1275 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu mber, int columnNumber, BreakpointSource source)
1257 { 1276 {
1258 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so urce)); 1277 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so urce));
1259 } 1278 }
1260 1279
1261 void InspectorDebuggerAgent::reset() 1280 void InspectorDebuggerAgent::reset()
1262 { 1281 {
1263 m_scripts.clear(); 1282 m_scripts.clear();
1264 m_breakpointIdToDebugServerBreakpointIds.clear(); 1283 m_breakpointIdToDebugServerBreakpointIds.clear();
1265 m_asyncCallStackTracker.clear(); 1284 m_asyncCallStackTracker.clear();
1285 m_promiseOfficer.clear();
1266 if (m_frontend) 1286 if (m_frontend)
1267 m_frontend->globalObjectCleared(); 1287 m_frontend->globalObjectCleared();
1268 } 1288 }
1269 1289
1270 } // namespace WebCore 1290 } // namespace WebCore
1271 1291
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698