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

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

Issue 297683002: Remove DevTools instrumentation of Blink promises. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 if (m_asyncCallStackTracker.isEnabled()) 758 if (m_asyncCallStackTracker.isEnabled())
759 m_asyncCallStackTracker.willDeliverMutationRecords(context, observer); 759 m_asyncCallStackTracker.willDeliverMutationRecords(context, observer);
760 } 760 }
761 761
762 void InspectorDebuggerAgent::didDeliverMutationRecords() 762 void InspectorDebuggerAgent::didDeliverMutationRecords()
763 { 763 {
764 if (m_asyncCallStackTracker.isEnabled()) 764 if (m_asyncCallStackTracker.isEnabled())
765 m_asyncCallStackTracker.didFireAsyncCall(); 765 m_asyncCallStackTracker.didFireAsyncCall();
766 } 766 }
767 767
768 void InspectorDebuggerAgent::didPostPromiseTask(ExecutionContext* context, Execu tionContextTask* task, bool isResolved)
769 {
770 if (m_asyncCallStackTracker.isEnabled())
771 m_asyncCallStackTracker.didPostPromiseTask(context, task, isResolved, sc riptDebugServer().currentCallFramesForAsyncStack());
772 }
773
774 void InspectorDebuggerAgent::willPerformPromiseTask(ExecutionContext* context, E xecutionContextTask* task)
775 {
776 if (m_asyncCallStackTracker.isEnabled())
777 m_asyncCallStackTracker.willPerformPromiseTask(context, task);
778 }
779
780 void InspectorDebuggerAgent::didPerformPromiseTask()
781 {
782 if (m_asyncCallStackTracker.isEnabled())
783 m_asyncCallStackTracker.didFireAsyncCall();
784 }
785
786 bool InspectorDebuggerAgent::isPromiseTrackerEnabled()
787 {
788 return m_promiseTracker.isEnabled();
789 }
790
791 void InspectorDebuggerAgent::didCreatePromise(const ScriptObject& promise)
792 {
793 if (m_promiseTracker.isEnabled())
794 m_promiseTracker.didCreatePromise(promise);
795 }
796
797 void InspectorDebuggerAgent::didUpdatePromiseParent(const ScriptObject& promise, const ScriptObject& parentPromise)
798 {
799 if (m_promiseTracker.isEnabled())
800 m_promiseTracker.didUpdatePromiseParent(promise, parentPromise);
801 }
802
803 void InspectorDebuggerAgent::didUpdatePromiseState(const ScriptObject& promise, V8PromiseCustom::PromiseState state, const ScriptValue& result)
804 {
805 if (m_promiseTracker.isEnabled())
806 m_promiseTracker.didUpdatePromiseState(promise, state, result);
807 }
808
809 void InspectorDebuggerAgent::pause(ErrorString*) 768 void InspectorDebuggerAgent::pause(ErrorString*)
810 { 769 {
811 if (m_javaScriptPauseScheduled) 770 if (m_javaScriptPauseScheduled)
812 return; 771 return;
813 clearBreakDetails(); 772 clearBreakDetails();
814 scriptDebugServer().setPauseOnNextStatement(true); 773 scriptDebugServer().setPauseOnNextStatement(true);
815 m_javaScriptPauseScheduled = true; 774 m_javaScriptPauseScheduled = true;
816 } 775 }
817 776
818 void InspectorDebuggerAgent::resume(ErrorString* errorString) 777 void InspectorDebuggerAgent::resume(ErrorString* errorString)
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 scriptDebugServer().breakProgram(); 1196 scriptDebugServer().breakProgram();
1238 } 1197 }
1239 1198
1240 void InspectorDebuggerAgent::clear() 1199 void InspectorDebuggerAgent::clear()
1241 { 1200 {
1242 m_pausedScriptState = nullptr; 1201 m_pausedScriptState = nullptr;
1243 m_currentCallStack = ScriptValue(); 1202 m_currentCallStack = ScriptValue();
1244 m_scripts.clear(); 1203 m_scripts.clear();
1245 m_breakpointIdToDebugServerBreakpointIds.clear(); 1204 m_breakpointIdToDebugServerBreakpointIds.clear();
1246 m_asyncCallStackTracker.clear(); 1205 m_asyncCallStackTracker.clear();
1247 m_promiseTracker.clear();
1248 m_continueToLocationBreakpointId = String(); 1206 m_continueToLocationBreakpointId = String();
1249 clearBreakDetails(); 1207 clearBreakDetails();
1250 m_javaScriptPauseScheduled = false; 1208 m_javaScriptPauseScheduled = false;
1251 ErrorString error; 1209 ErrorString error;
1252 setOverlayMessage(&error, 0); 1210 setOverlayMessage(&error, 0);
1253 } 1211 }
1254 1212
1255 bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString) 1213 bool InspectorDebuggerAgent::assertPaused(ErrorString* errorString)
1256 { 1214 {
1257 if (!m_pausedScriptState) { 1215 if (!m_pausedScriptState) {
(...skipping 19 matching lines...) Expand all
1277 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu mber, int columnNumber, BreakpointSource source) 1235 void InspectorDebuggerAgent::removeBreakpoint(const String& scriptId, int lineNu mber, int columnNumber, BreakpointSource source)
1278 { 1236 {
1279 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so urce)); 1237 removeBreakpoint(generateBreakpointId(scriptId, lineNumber, columnNumber, so urce));
1280 } 1238 }
1281 1239
1282 void InspectorDebuggerAgent::reset() 1240 void InspectorDebuggerAgent::reset()
1283 { 1241 {
1284 m_scripts.clear(); 1242 m_scripts.clear();
1285 m_breakpointIdToDebugServerBreakpointIds.clear(); 1243 m_breakpointIdToDebugServerBreakpointIds.clear();
1286 m_asyncCallStackTracker.clear(); 1244 m_asyncCallStackTracker.clear();
1287 m_promiseTracker.clear();
1288 if (m_frontend) 1245 if (m_frontend)
1289 m_frontend->globalObjectCleared(); 1246 m_frontend->globalObjectCleared();
1290 } 1247 }
1291 1248
1292 } // namespace WebCore 1249 } // namespace WebCore
1293 1250
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