New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 39 users
Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2014
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug


Sign in to add a comment
DevTools: support asynchronous call stacks
Project Member Reported by paulir...@chromium.org, Aug 13 2013 Back to list
It'd be hugely valuable to work back to the source of an asynchronous event.

Use cases:
* Long-running timers
* XHRs
* Promises

I imagine we could cull the call stack if the nesting depth is beyond a threshold (like 4). 


 
Comment 1 by prybin@chromium.org, Sep 10 2013
In my work in Java I usually simply added a code that created and saved exception in every instance – a very simple holder for the construction stacktrace.
With LiveEdit it could be even easier. I wonder if it can actually be done for these use-cases.
Comment 2 Deleted
Comment 3 by n...@nath.is, Oct 11 2013
This would be massively helpful in cases like require.js and other ajax-based things (read jQuery). I see no real need to cull the stack trace though? Unless it would hamper speed keeping something like that in memory? I'm not too familiar with how V8/DevTools work. 
Cc: prybin@chromium.org
Owner: aandrey@chromium.org
Status: Assigned
Issue 240818 has been merged into this issue.
Blocking: chromium:169721
Blocking: chromium:313297
+1 for not culling the stack trace if possible.
Cc: -prybin@chromium.org
patches:
https://codereview.chromium.org/74063002/
https://codereview.chromium.org/80383004/

async-calls-screenshot.png
183 KB View Download
Can we include MutationObservers (microtasks) and Promises?
I'll look into it. The wish list is the following:

* Timers
* Animation frames
* XHRs
* Event listeners
* Promises
* MutationObservers

What else?
Comment 12 by n...@nath.is, Nov 22 2013
For Event Listeners, how would the stack work? Would it follow back to where the event handler was assigned? Also, Promises aren't a concept inherently understood by the browser, so it makes no sense to support them directly? Just support whatever asynchronous technology they usually use under the hood? 
Comment 13 by m...@theswoon.com, Nov 28 2013
+1.

I'm also trying to work up an (deliverable) spec for setting async callback breakpoints over at https://code.google.com/p/chromium/issues/detail?id=323694 if you have any ideas.
Nat, promises are already implemented in blink. If you look in the Canary
Build you'll see them.
Comment 15 by n...@nath.is, Nov 28 2013
Wait what, native promises?! Anymore information on this one?
Comment 16 by ja...@parall.ax, Nov 28 2013
Native promises is cool..
http://src.chromium.org/viewvc/blink?view=revision&revision=160850
Project Member Comment 18 by bugdroid1@chromium.org, Dec 3 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163099

------------------------------------------------------------------------
r163099 | aandrey@chromium.org | 2013-12-03T17:26:58.714164Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/protocol.json?r1=163099&r2=163098&pathrev=163099
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=163099&r2=163098&pathrev=163099
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/Script.js?r1=163099&r2=163098&pathrev=163099
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/DebuggerModel.js?r1=163099&r2=163098&pathrev=163099
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=163099&r2=163098&pathrev=163099

DevTools: Introduce Debugger.StackTrace structure in protocol.json

This will be used to send async traces from backend to front-end.

BUG=272416
R=pfeldman@chromium.org, yurys@chromium.org

Review URL: https://codereview.chromium.org/98953004
------------------------------------------------------------------------
Project Member Comment 19 by bugdroid1@chromium.org, Dec 5 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163266

------------------------------------------------------------------------
r163266 | aandrey@chromium.org | 2013-12-05T14:59:22.684103Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/debugger-return-value.html?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/protocol.json?r1=163266&r2=163265&pathrev=163266
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack.html?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=163266&r2=163265&pathrev=163266
   A http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/ScriptDebugServer.cpp?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=163266&r2=163265&pathrev=163266
   A http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/debugger-activation-crash2.html?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/ScriptDebugServer.h?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/debugger-test.js?r1=163266&r2=163265&pathrev=163266
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-expected.txt?r1=163266&r2=163265&pathrev=163266
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/core.gypi?r1=163266&r2=163265&pathrev=163266

DevTools: Support asynchronous call stacks on backend.

Track asynchronous call stacks for setTimeout/setInterval and requestAnimationFrame on the backend.

BUG=272416
R=pfeldman@chromium.org, yurys@chromium.org, caseq@chromium.org

Review URL: https://codereview.chromium.org/74063002
------------------------------------------------------------------------
Project Member Comment 20 by bugdroid1@chromium.org, Dec 6 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163353

------------------------------------------------------------------------
r163353 | aandrey@chromium.org | 2013-12-06T17:40:48.782646Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/ScriptDebugServer.cpp?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=163353&r2=163352&pathrev=163353
   A http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/debugger-activation-crash2.html?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/ScriptDebugServer.h?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/debugger-test.js?r1=163353&r2=163352&pathrev=163353
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-expected.txt?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/inspector-test.js?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/core.gypi?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/debugger-return-value.html?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/protocol.json?r1=163353&r2=163352&pathrev=163353
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack.html?r1=163353&r2=163352&pathrev=163353
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=163353&r2=163352&pathrev=163353
   A http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=163353&r2=163352&pathrev=163353

DevTools: Support asynchronous call stacks on backend.

Track asynchronous call stacks for setTimeout/setInterval and requestAnimationFrame on the backend.

BUG=272416, 326479
R=pfeldman@chromium.org, yurys@chromium.org, caseq@chromium.org

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163266

Review URL: https://codereview.chromium.org/74063002
------------------------------------------------------------------------
Project Member Comment 21 by bugdroid1@chromium.org, Dec 6 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163361

------------------------------------------------------------------------
r163361 | aandrey@chromium.org | 2013-12-06T19:52:16.981404Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/DebuggerModel.js?r1=163361&r2=163360&pathrev=163361
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/Placard.js?r1=163361&r2=163360&pathrev=163361
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/sidebarPane.css?r1=163361&r2=163360&pathrev=163361
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/CallStackSidebarPane.js?r1=163361&r2=163360&pathrev=163361
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/Settings.js?r1=163361&r2=163360&pathrev=163361
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/SettingsScreen.js?r1=163361&r2=163360&pathrev=163361
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/inspector.css?r1=163361&r2=163360&pathrev=163361
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/SourcesPanel.js?r1=163361&r2=163360&pathrev=163361
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/Script.js?r1=163361&r2=163360&pathrev=163361

DevTools: Show asynchronous call stacks on frontend.

This depends on https://codereview.chromium.org/74063002/

BUG=272416
R=pfeldman@chromium.org, yurys@chromium.org, caseq@chromium.org

Review URL: https://codereview.chromium.org/80383004
------------------------------------------------------------------------
New screenshot.
async-calls-screenshot.png
26.3 KB View Download
Project Member Comment 23 by bugdroid1@chromium.org, Dec 9 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163448

------------------------------------------------------------------------
r163448 | aandrey@chromium.org | 2013-12-09T18:25:32.237665Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/sidebarPane.css?r1=163448&r2=163447&pathrev=163448
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/CallStackSidebarPane.js?r1=163448&r2=163447&pathrev=163448
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/Settings.js?r1=163448&r2=163447&pathrev=163448
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/SettingsScreen.js?r1=163448&r2=163447&pathrev=163448
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/DebuggerModel.js?r1=163448&r2=163447&pathrev=163448
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/Placard.js?r1=163448&r2=163447&pathrev=163448

DevTools: Add a checkbox to enable async stacks in the sidebar header.

This also removes the checkbox from the Settings page.

BUG=272416
R=pfeldman, yurys

Review URL: https://codereview.chromium.org/102833003
------------------------------------------------------------------------
Project Member Comment 24 by bugdroid1@chromium.org, Dec 10 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163553

------------------------------------------------------------------------
r163553 | aandrey@chromium.org | 2013-12-10T18:42:37.946024Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=163553&r2=163552&pathrev=163553
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=163553&r2=163552&pathrev=163553
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=163553&r2=163552&pathrev=163553

DevTools: Track async stacks on the corresponding execution context.

We should track async stacks separately for each execution context,
so that async event IDs (like timer ID) from different execution
contexts (e.g. iframes) should not mess with each other.

BUG=272416
R=yurys, pfeldman

Review URL: https://codereview.chromium.org/111653002
------------------------------------------------------------------------
Project Member Comment 25 by bugdroid1@chromium.org, Dec 10 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163561

------------------------------------------------------------------------
r163561 | aandrey@chromium.org | 2013-12-10T20:13:04.811662Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=163561&r2=163560&pathrev=163561
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=163561&r2=163560&pathrev=163561
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/DebuggerModel.js?r1=163561&r2=163560&pathrev=163561
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=163561&r2=163560&pathrev=163561
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/debugger-test.js?r1=163561&r2=163560&pathrev=163561
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-expected.txt?r1=163561&r2=163560&pathrev=163561
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/CallStackSidebarPane.js?r1=163561&r2=163560&pathrev=163561
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/protocol.json?r1=163561&r2=163560&pathrev=163561

DevTools: Display function names instead of general "[Async Call]".

Display async call function's name, like setTimeout or requestAnimationFrame.

BUG=272416
R=pfeldman

Review URL: https://codereview.chromium.org/106973009
------------------------------------------------------------------------
Project Member Comment 26 by bugdroid1@chromium.org, Dec 11 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=163693

------------------------------------------------------------------------
r163693 | aandrey@chromium.org | 2013-12-11T09:56:36.667526Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=163693&r2=163692&pathrev=163693

DevTools: Restore capture async traces state on page navigation.

BUG=272416
R=pfeldman

Review URL: https://codereview.chromium.org/111543005
------------------------------------------------------------------------
Project Member Comment 27 by bugdroid1@chromium.org, Dec 18 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=164080

------------------------------------------------------------------------
r164080 | aandrey@chromium.org | 2013-12-18T10:10:27.626397Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack.html?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDOMDebuggerAgent.cpp?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.cpp?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDOMDebuggerAgent.h?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.h?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-expected.txt?r1=164080&r2=164079&pathrev=164080
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/events/EventTarget.cpp?r1=164080&r2=164079&pathrev=164080

DevTools: Capture async stacks for event listeners.

BUG=272416
R=yurys@chromium.org

Review URL: https://codereview.chromium.org/114033002
------------------------------------------------------------------------
Project Member Comment 28 by bugdroid1@chromium.org, Dec 23 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=164291

------------------------------------------------------------------------
r164291 | aandrey@chromium.org | 2013-12-23T13:59:13.621521Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack.html?r1=164291&r2=164290&pathrev=164291
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=164291&r2=164290&pathrev=164291
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=164291&r2=164290&pathrev=164291
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-xhrs.html?r1=164291&r2=164290&pathrev=164291
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=164291&r2=164290&pathrev=164291
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=164291&r2=164290&pathrev=164291
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=164291&r2=164290&pathrev=164291
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-middle-run-expected.txt?r1=164291&r2=164290&pathrev=164291
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/debugger-test.js?r1=164291&r2=164290&pathrev=164291
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-expected.txt?r1=164291&r2=164290&pathrev=164291
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/inspector-test.js?r1=164291&r2=164290&pathrev=164291
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-xhrs-expected.txt?r1=164291&r2=164290&pathrev=164291
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-middle-run.html?r1=164291&r2=164290&pathrev=164291

DevTools: Support XHR async call stacks in the debugger.

With this we will collect XHR async call stacks at the point of
calling XHR.send() rather than at XHR.addEventListener() or at
assigning XHR.onreadystatechange.

For XMLHttpRequestUpload event target callbacks show async call stacks
of the owner XHR object.

Drive-by: Do strict counting of the nested willHandleEvent callbacks.

BUG=272416
R=yurys@chromium.org

Review URL: https://codereview.chromium.org/118293002
------------------------------------------------------------------------
Comment 29 by n...@nath.is, Dec 23 2013
Why do you want to track at send rather than at addEventListener?
Cc: paulir...@chromium.org
So, at the moment we do collect async call stacks at the time of calling addEventListener for all EventTarget's, and show them upon firing the event.

For XHRs, however, it seems more logical to bind to the XHR.send() since this is the actual source and initiator of the "async call".
In other words, being stopped inside an XHR's onreadystatechanged callback, for example, one would likely be interested to see the state that this XHR was initiated with (Local Scope variables, Call Stack and etc.), than the state when the addEventListener happened.

Same may be true for other events, like image.onerror, where one would probably want to see where image.src was assigned, rather than the addEventListener.

We are open for discussions and your feedback.

Comment 31 by n...@nath.is, Dec 23 2013
I guess it'd be easier to imagine the difference when I have the UI to play
with.
Blockedon: chromium:329659
Current status:

+ Timers
+ Animation frames
+ XHRs
+ Event listeners
- MutationObservers: pending https://codereview.chromium.org/119613004/
- Promises
- CustomElement lifecycle callbacks

Project Member Comment 33 by bugdroid1@chromium.org, Dec 27 2013
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=164358

------------------------------------------------------------------------
r164358 | aandrey@chromium.org | 2013-12-27T11:42:06.160560Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-mutation-observer.html?r1=164358&r2=164357&pathrev=164358
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=164358&r2=164357&pathrev=164358
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=164358&r2=164357&pathrev=164358
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=164358&r2=164357&pathrev=164358
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/MutationObserver.cpp?r1=164358&r2=164357&pathrev=164358
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-mutation-observer-expected.txt?r1=164358&r2=164357&pathrev=164358
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=164358&r2=164357&pathrev=164358
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=164358&r2=164357&pathrev=164358

DevTools: Add MutationObserver instrumentation for async stacks tracking.

Bind async call stack for a MutationCallback call to the first point in the
code that enqueued a MutationRecord into a given MutationObserver instance.

For example, while paused in a MutationObserver callback, we will show an
async call stack pointing to the earliest place in the code where one of the
received DOM mutations happened (usually the first one).

BUG=272416
R=yurys

Review URL: https://codereview.chromium.org/119613004
------------------------------------------------------------------------
Cc: tkonch...@chromium.org yhirano@chromium.org
Issue 313297 has been merged into this issue.
Comment 35 by arv@chromium.org, Jan 10 2014
Cc: rafaelw@chromium.org rossberg@chromium.org adamk@chromium.org
Can we add Object.observe callbacks to the async callback lists?
Note that MutationObservers and Object.observe potentially have multiple sources of the callback since a single callback can deliver records from N changes.
Comment 37 by m.go...@gmail.com, Jan 10 2014
@rafaelw True, but often there will be only one source. It would be great to cover at least this scenario.
For MutationObserver the async stack will point to the first DOM mutation. I guess, same logic should apply for Object.observe

Updated list:

+ Timers
+ Animation frames
+ XHRs
+ Event listeners
+ MutationObservers
- Promises
- CustomElement lifecycle callbacks
- Object.observe
Project Member Comment 40 by bugdroid1@chromium.org, Jan 16 2014
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=165226

------------------------------------------------------------------------
r165226 | aandrey@chromium.org | 2014-01-16T14:54:14.772574Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-promises.html?r1=165226&r2=165225&pathrev=165226
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=165226&r2=165225&pathrev=165226
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=165226&r2=165225&pathrev=165226
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/custom/V8PromiseCustom.cpp?r1=165226&r2=165225&pathrev=165226
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=165226&r2=165225&pathrev=165226
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=165226&r2=165225&pathrev=165226
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=165226&r2=165225&pathrev=165226
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/custom/V8PromiseCustom.h?r1=165226&r2=165225&pathrev=165226
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-promises-expected.txt?r1=165226&r2=165225&pathrev=165226

DevTools: Implement async call stacks for Promises.

BUG=272416
R=yurys, vsevik, yusukesuzuki, yhirano

Review URL: https://codereview.chromium.org/131823003
------------------------------------------------------------------------
Project Member Comment 41 by bugdroid1@chromium.org, Jan 24 2014
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=165738

------------------------------------------------------------------------
r165738 | aandrey@chromium.org | 2014-01-24T13:31:57.055443Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-eval-expected.txt?r1=165738&r2=165737&pathrev=165738
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InjectedScript.cpp?r1=165738&r2=165737&pathrev=165738
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=165738&r2=165737&pathrev=165738
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/console/console-format-expected.txt?r1=165738&r2=165737&pathrev=165738
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/debugger/async-callstack-eval.html?r1=165738&r2=165737&pathrev=165738
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InjectedScript.h?r1=165738&r2=165737&pathrev=165738
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/ScriptFunctionCall.cpp?r1=165738&r2=165737&pathrev=165738
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InjectedScriptSource.js?r1=165738&r2=165737&pathrev=165738
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/ScriptFunctionCall.h?r1=165738&r2=165737&pathrev=165738

DevTools: Implement evaluation on async call frames.

We emulate evaluation on an async call frame by doing evaluation on the global object with an extended context derived from the async call frame scope chain.

BUG=272416
R=yurys

Review URL: https://codereview.chromium.org/136333007
------------------------------------------------------------------------
Hi, a great feature, 
but once I've cleared the async checkbox it disappeared and never returned, how can i restore the helpful checkbox?
I believe he feature was moved behind experiment. You should at first enable it in experiments section to get the "async" checkbox in the UI
Comment 44 Deleted
Comment 45 Deleted
OK Thanks, finally found it, 
had to:
enable dev tools exeprimets
"enable support for async stack traces"  in dev tools settings
restart chrome
the checkbox is back
Blockedon: chromium:340285
Project Member Comment 48 by bugdroid1@chromium.org, Mar 25 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=169965

------------------------------------------------------------------
r169965 | aandrey@chromium.org | 2014-03-25T17:31:08.024764Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/DebuggerModel.js?r1=169965&r2=169964&pathrev=169965
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/CallStackSidebarPane.js?r1=169965&r2=169964&pathrev=169965
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/Settings.js?r1=169965&r2=169964&pathrev=169965

DevTools: Async stacks out of experiments.

BUG=272416
R=pfeldman

Review URL: https://codereview.chromium.org/202113007
-----------------------------------------------------------------
Would it be feasible to export setAsyncCallChain to the frontend, combined with some mechanism to collect a ref to the current chain? I can really imagine a more generic use for this.

E.g. any custom observer framework that uses a single global setTimeout to emit changes. If a call chain ref could be retrieved at change-time, it could be rebound when firing the async change. Multiplexing http request libraries would benefit in a similar fashion.

Unsure about what kind of API this would need...
Comment 50 by srous...@gmail.com, Apr 29 2014
Hey Paul, for reference: https://code.google.com/p/fbug/issues/detail?id=3973

;)
Project Member Comment 51 by bugdroid1@chromium.org, May 23 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=174627

------------------------------------------------------------------
r174627 | aandrey@chromium.org | 2014-05-23T01:32:17.045756Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-middle-run.html?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack.html?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-middle-run-expected.txt?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/events/EventTarget.cpp?r1=174627&r2=174626&pathrev=174627
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-expected.txt?r1=174627&r2=174626&pathrev=174627

DevTools: Remove async call stacks support for EventTarget.addEventListener.

BUG=372602, 370826, 272416
R=pfeldman, yurys

Review URL: https://codereview.chromium.org/297823003
-----------------------------------------------------------------
Comment 52 by n...@nath.is, May 23 2014
Why were addEventListener async call stacks removed? 
Project Member Comment 53 by bugdroid1@chromium.org, May 29 2014
Labels: merge-merged-1985
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=175042

------------------------------------------------------------------
r175042 | aandrey@chromium.org | 2014-05-29T09:41:20.659976Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/LayoutTests/inspector/sources/debugger/async-callstack.html?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/Source/core/inspector/InspectorDebuggerAgent.h?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/Source/core/inspector/AsyncCallStackTracker.h?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/Source/core/inspector/InspectorInstrumentation.idl?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/LayoutTests/inspector/sources/debugger/async-callstack-middle-run-expected.txt?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/Source/core/events/EventTarget.cpp?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/LayoutTests/inspector/sources/debugger/async-callstack-expected.txt?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/LayoutTests/inspector/sources/debugger/async-callstack-middle-run.html?r1=175042&r2=175041&pathrev=175042
   M http://src.chromium.org/viewvc/blink/branches/chromium/1985/Source/core/inspector/AsyncCallStackTracker.cpp?r1=175042&r2=175041&pathrev=175042

Merge 174627 "DevTools: Remove async call stacks support for Eve..."

> DevTools: Remove async call stacks support for EventTarget.addEventListener.
> 
> BUG=372602, 370826, 272416
> R=pfeldman, yurys
> 
> Review URL: https://codereview.chromium.org/297823003

TBR=aandrey@chromium.org

Review URL: https://codereview.chromium.org/309453003
-----------------------------------------------------------------
Sad to see this be removed :'(
Is there any possibility to support Chrome APIs (chrome.*) and File API?
File API is definitely possible and should be implemented if there is much interest.

Chrome API is a totally different story. I can not answer right away if it's feasible to do at all.
Project Member Comment 57 by bugdroid1@chromium.org, Jun 16 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=176221

------------------------------------------------------------------
r176221 | aandrey@chromium.org | 2014-06-16T16:44:30.693946Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-scripted-scroll.html?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/events/EventTarget.cpp?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ScriptedAnimationController.cpp?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDOMDebuggerAgent.cpp?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=176221&r2=176220&pathrev=176221
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-scripted-scroll-expected.txt?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDOMDebuggerAgent.h?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=176221&r2=176220&pathrev=176221
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=176221&r2=176220&pathrev=176221

DevTools: Support async call stacks for scripted animation events (like scroll).

BUG=272416
R=yurys@chromium.org, pfeldman@chromium.org

Review URL: https://codereview.chromium.org/332493002
-----------------------------------------------------------------
Project Member Comment 58 by bugdroid1@chromium.org, Jun 17 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=176352

------------------------------------------------------------------
r176352 | aandrey@chromium.org | 2014-06-17T21:02:46.631215Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ScriptedAnimationController.cpp?r1=176352&r2=176351&pathrev=176352
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=176352&r2=176351&pathrev=176352
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=176352&r2=176351&pathrev=176352
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/events/DOMWindowEventQueue.cpp?r1=176352&r2=176351&pathrev=176352
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-events.html?r1=176352&r2=176351&pathrev=176352
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=176352&r2=176351&pathrev=176352
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=176352&r2=176351&pathrev=176352
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=176352&r2=176351&pathrev=176352
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/workers/WorkerEventQueue.cpp?r1=176352&r2=176351&pathrev=176352
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-events-expected.txt?r1=176352&r2=176351&pathrev=176352

DevTools: Instrument DOMWindowEventQueue for async stacks.

This adds async stacks support for the following DOM events:
- hashchange
- selectionchange
- pointerlockchange and others
- securitypolicyviolation
- storage

BUG=272416
R=yurys, pfeldman@chromium.org

Review URL: https://codereview.chromium.org/333333002
-----------------------------------------------------------------
Project Member Comment 59 by bugdroid1@chromium.org, Jun 19 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=176523

------------------------------------------------------------------
r176523 | aandrey@chromium.org | 2014-06-19T16:24:48.593927Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-events.html?r1=176523&r2=176522&pathrev=176523
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/events/GenericEventQueue.cpp?r1=176523&r2=176522&pathrev=176523
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-events-expected.txt?r1=176523&r2=176522&pathrev=176523

DevTools: Instrument GenericEventQueue for async stacks.

This adds async stacks support for the following DOM events:
- audio & video events (play, pause, ratechange, etc.)
- TrackList events: addtrack, removetrack
- MediaSource events (sourceopen and etc.)
- autocomplete and others

BUG=272416
R=yurys, pfeldman@chromium.org

Review URL: https://codereview.chromium.org/335963004
-----------------------------------------------------------------
Blockedon: chromium:390863 chromium:390865
As an aside, Indexed DB requests (IDBRequest) would be another great place to have async stack collection/reporting. But given that it's a database API, performance is critical - lots of requests get created.

I've been casually looking at hooking up window.onerror to uncaught IDB errors (which Firefox does), which has similar stack capture requirements. Initial testing showed unacceptable performance impact: https://codereview.chromium.org/243523003/ - I'll try limiting the size of the collected stack and see if that helps.


Project Member Comment 62 by bugdroid1@chromium.org, Jul 9 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=177772

------------------------------------------------------------------
r177772 | chrome-bot@google.com | 2014-07-09T21:15:11.082259Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/clipboard/DataTransferItem.cpp?r1=177772&r2=177771&pathrev=177772
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-get-as-string-expected.txt?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ExecutionContextTask.h?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/StringCallback.cpp?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/workers/WorkerRunLoop.cpp?r1=177772&r2=177771&pathrev=177772
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-get-as-string.html?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/StringCallback.h?r1=177772&r2=177771&pathrev=177772
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/MainThreadTaskRunner.cpp?r1=177772&r2=177771&pathrev=177772

Add InspectorInstrumentation over ExecutionContextTask and async call stacks for DataTransferItem.getAsString.

This instrumentation is needed to support async call stacks in DevTools on various async scenarios.
An example test is for DataTransferItem.getAsString() call.

BUG=272416
R=pfeldman, yurys@chromium.org

Review URL: https://codereview.chromium.org/365253003
-----------------------------------------------------------------
Project Member Comment 63 by bugdroid1@chromium.org, Jul 10 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=177873

------------------------------------------------------------------
r177873 | aandrey@chromium.org | 2014-07-10T19:44:47.868928Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-object-observe-expected.txt?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=177873&r2=177872&pathrev=177873
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-object-observe.html?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-promises-expected.txt?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/core/v8/ScriptDebugServer.cpp?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/ScriptDebugListener.h?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/TestExpectations?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/core/v8/ScriptDebugServer.h?r1=177873&r2=177872&pathrev=177873
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=177873&r2=177872&pathrev=177873

DevTools: Async call stacks for Promises and Object.observe.

BUG=272416, 356567
R=yurys, pfeldman@chromium.org

Review URL: https://codereview.chromium.org/374903002
-----------------------------------------------------------------
Blockedon: chromium:393175
Project Member Comment 65 by bugdroid1@chromium.org, Jul 15 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=178149

------------------------------------------------------------------
r178149 | aandrey@chromium.org | 2014-07-15T08:18:02.741024Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=178149&r2=178148&pathrev=178149
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=178149&r2=178148&pathrev=178149
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/CodeGeneratorInstrumentation.py?r1=178149&r2=178148&pathrev=178149
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/filesystem/async-callstack-filesystem.html?r1=178149&r2=178148&pathrev=178149
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=178149&r2=178148&pathrev=178149
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=178149&r2=178148&pathrev=178149
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=178149&r2=178148&pathrev=178149
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/FileSystemCallbacks.cpp?r1=178149&r2=178148&pathrev=178149
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/filesystem/async-callstack-filesystem-expected.txt?r1=178149&r2=178148&pathrev=178149
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/DOMFileSystem.h?r1=178149&r2=178148&pathrev=178149

DevTools: Support async call stacks for FileSystem API (part 1).

This patch does not yet tracks async stacks for FileWriter and FileReader.

BUG=272416, 390863
R=kinuko@chromium.org, nhiroki@chromium.org, yurys

Review URL: https://codereview.chromium.org/383123009
-----------------------------------------------------------------
Project Member Comment 66 by bugdroid1@chromium.org, Jul 15 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=178154

------------------------------------------------------------------
r178154 | aandrey@chromium.org | 2014-07-15T08:49:41.144189Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-events.html?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-xhrs.html?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/xml/XMLHttpRequest.cpp?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-events-expected.txt?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-xhrs-expected.txt?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=178154&r2=178153&pathrev=178154
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=178154&r2=178153&pathrev=178154

DevTools: Fix async stacks instrumentation for XHRs.

This fixes 2 bugs:
- XHR async call stacks could be deleted too early having the second onloadend
  callback w/o async stacks.
- XHR async call stacks were not deleted at all if there was no onloadend event
  listener attached (aka memory leak).

BUG=272416
R=yurys, pfeldman@chromium.org

Review URL: https://codereview.chromium.org/383363002
-----------------------------------------------------------------
Project Member Comment 67 by bugdroid1@chromium.org, Jul 16 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=178269

------------------------------------------------------------------
r178269 | pfeldman@chromium.org | 2014-07-16T12:11:33.201584Z

Changed paths:
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/filesystem/async-callstack-filesystem.html?r1=178269&r2=178268&pathrev=178269
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=178269&r2=178268&pathrev=178269
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=178269&r2=178268&pathrev=178269
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=178269&r2=178268&pathrev=178269
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/FileSystemCallbacks.cpp?r1=178269&r2=178268&pathrev=178269
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/filesystem/async-callstack-filesystem-expected.txt?r1=178269&r2=178268&pathrev=178269
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/DOMFileSystem.h?r1=178269&r2=178268&pathrev=178269
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=178269&r2=178268&pathrev=178269
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=178269&r2=178268&pathrev=178269
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/CodeGeneratorInstrumentation.py?r1=178269&r2=178268&pathrev=178269

Revert of DevTools: Support async call stacks for FileSystem API (part 1). (https://codereview.chromium.org/383123009/)

Reason for revert:
This seems to add a lot of complexity into async code + violates the modularity: core/inspector should not be aware of the filesystems.

Original issue's description:
> DevTools: Support async call stacks for FileSystem API (part 1).
> 
> This patch does not yet tracks async stacks for FileWriter and FileReader.
> 
> BUG=272416, 390863
> R=kinuko@chromium.org, nhiroki@chromium.org, yurys
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178149

TBR=kinuko@chromium.org,nhiroki@chromium.org,yurys@chromium.org,aandrey@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=272416, 390863

Review URL: https://codereview.chromium.org/397843009
-----------------------------------------------------------------
Blockedon: chromium:332624
Project Member Comment 69 by bugdroid1@chromium.org, Jul 22 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=178698

------------------------------------------------------------------
r178698 | aandrey@chromium.org | 2014-07-22T21:58:07.607007Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-post-message-expected.txt?r1=178698&r2=178697&pathrev=178698
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=178698&r2=178697&pathrev=178698
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.h?r1=178698&r2=178697&pathrev=178698
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=178698&r2=178697&pathrev=178698
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-in-console.html?r1=178698&r2=178697&pathrev=178698
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-post-message.html?r1=178698&r2=178697&pathrev=178698
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/resources/post-message-listener.html?r1=178698&r2=178697&pathrev=178698
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/frame/LocalDOMWindow.cpp?r1=178698&r2=178697&pathrev=178698
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=178698&r2=178697&pathrev=178698
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/AsyncCallStackTracker.cpp?r1=178698&r2=178697&pathrev=178698
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/CodeGeneratorInstrumentation.py?r1=178698&r2=178697&pathrev=178698

DevTools: Async call stacks for window.postMessage()

This introduces a more general instrumentation approach for tracing async calls
that could also be an entry point for public Debug API.

This patch also allows showing debugger async call stacks across the execution
contexts.

BUG=393175,272416
R=pfeldman, yurys

Review URL: https://codereview.chromium.org/404953003
-----------------------------------------------------------------
aandrey, can you summarize what we have coverage for nowadays?
Async stacks coverage in ToT:

+ Timers
+ Animation frames
+ XHRs
+ MutationObservers
+ Promises
+ Object.observe
+ DOM events originating from scripts: scroll, hashchange, selectionchange, pointerlockchange, audio & video (play, pause, ratechange, etc.) and few others
+ DataTransferItem.getAsString()
+ window.postMessage()

TODO:
- IndexedDB (bug 390865)
- Custom frameworks (bug 332624)

Project Member Comment 72 by bugdroid1@chromium.org, Aug 6 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=179585

------------------------------------------------------------------
r179585 | aandrey@chromium.org | 2014-08-06T08:48:59.500879Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/filesystem/async-callstack-filesystem.html?r1=179585&r2=179584&pathrev=179585
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/FileSystemCallbacks.cpp?r1=179585&r2=179584&pathrev=179585
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/filesystem/async-callstack-filesystem-expected.txt?r1=179585&r2=179584&pathrev=179585
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/DOMFileSystem.h?r1=179585&r2=179584&pathrev=179585
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/FileSystemCallbacks.h?r1=179585&r2=179584&pathrev=179585

DevTools: Async call stacks for FileSystem API part 1 (second try).

This uses a simpler instrumentation API.
First try was in r178149.

BUG=272416, 390863
R=yurys, pfeldman

Review URL: https://codereview.chromium.org/435423004
-----------------------------------------------------------------
Project Member Comment 73 by bugdroid1@chromium.org, Aug 6 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=179624

------------------------------------------------------------------
r179624 | aandrey@chromium.org | 2014-08-06T16:07:55.946784Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.h?r1=179624&r2=179623&pathrev=179624
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/FileWriter.h?r1=179624&r2=179623&pathrev=179624
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorInstrumentation.idl?r1=179624&r2=179623&pathrev=179624
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/fileapi/FileReader.cpp?r1=179624&r2=179623&pathrev=179624
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/http/tests/inspector/filesystem/async-callstack-filesystem-expected.txt?r1=179624&r2=179623&pathrev=179624
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/fileapi/FileReader.h?r1=179624&r2=179623&pathrev=179624
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/inspector/InspectorDebuggerAgent.cpp?r1=179624&r2=179623&pathrev=179624
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/FileWriter.cpp?r1=179624&r2=179623&pathrev=179624

DevTools: Async call stacks for FileSystem API part 2.

Instrumenting FileReader & FileWriter.

BUG=272416, 390863
R=pfeldman, yurys, kinuko@chromium.org, nhiroki@chromium.org

Review URL: https://codereview.chromium.org/440913002
-----------------------------------------------------------------
Project Member Comment 74 by bugdroid1@chromium.org, Aug 7 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=179754

------------------------------------------------------------------
r179754 | aandrey@chromium.org | 2014-08-07T21:10:48.253304Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-indexed-db-expected.txt?r1=179754&r2=179753&pathrev=179754
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-indexed-db.html?r1=179754&r2=179753&pathrev=179754
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp?r1=179754&r2=179753&pathrev=179754
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/indexeddb/WebIDBCallbacksImpl.h?r1=179754&r2=179753&pathrev=179754

DevTools: Implement async stacks for IndexedDB.

BUG=390865,272416
R=yurys

Review URL: https://codereview.chromium.org/439713009
-----------------------------------------------------------------
Project Member Comment 75 by bugdroid1@chromium.org, Sep 30 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=182985

------------------------------------------------------------------
r182985 | aandrey@chromium.org | 2014-09-30T21:29:45.688184Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ExecutionContextTask.h?r1=182985&r2=182984&pathrev=182985
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/webdatabase/DatabaseManager.cpp?r1=182985&r2=182984&pathrev=182985
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/StringCallback.cpp?r1=182985&r2=182984&pathrev=182985
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-web-sql-expected.txt?r1=182985&r2=182984&pathrev=182985
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/webdatabase/SQLStatement.cpp?r1=182985&r2=182984&pathrev=182985
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/webdatabase/SQLTransaction.cpp?r1=182985&r2=182984&pathrev=182985
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/inspector/sources/debugger/async-callstack-web-sql.html?r1=182985&r2=182984&pathrev=182985
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/webdatabase/SQLStatement.h?r1=182985&r2=182984&pathrev=182985
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/webdatabase/SQLTransaction.h?r1=182985&r2=182984&pathrev=182985
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/filesystem/DOMFileSystem.h?r1=182985&r2=182984&pathrev=182985

DevTools: Implement async stacks for WebSQL.

Although WebSQL is a deprecated specification, WebKit-based browsers will
likely maintain WebSQL support for the foreseeable future, so let's also
plumb async call stacks instrumentation framework to WebSQL.

BUG=272416
R=yurys, michaeln@chromium.org

Review URL: https://codereview.chromium.org/571383002
-----------------------------------------------------------------
Status: Fixed
Updated list:

+ Timers
+ Animation frames
+ XHRs
+ MutationObservers
+ Promises
+ Object.observe
+ DOM events originating from scripts: scroll, hashchange, selectionchange, pointerlockchange, audio & video (play, pause, ratechange, etc.) and few others
+ DataTransferItem.getAsString()
+ window.postMessage()
+ FileSystem API
+ IndexedDB
+ WebSQL

Thanks aandrey. I've updated the h5r article: https://github.com/html5rocks/www.html5rocks.com/commit/9f643a4195376262462526a0c58c13bdf59a94f5
Please add async support for Channel API[1]. 

Channel is currently used by default implementation of goog.async.nextTick[2] in Google Closure Library. We've grown to depend on it heavily in ClojureScript. For example popular core.async[3] library uses it internally to chain async operations.

I tried to work-around this limitation and monkey-patch goog.async.nextTick with a promise-based replacement[4]. It works technically, but the problem is that promises have slightly different timing characteristics (micro-tasks vs. tasks) and that caused issues for some[5].

Thanks for consideration.

[1] https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API
[2] https://github.com/google/closure-library/blob/fd043939bde2de4cd0dae9272e3336fbc5f66962/closure/goog/async/nexttick.js#L217
[3] https://github.com/clojure/core.async
[4] https://github.com/binaryage/cljs-devtools/blob/master/docs/faq.md#what-is-the-async-feature
[5] https://github.com/binaryage/cljs-devtools/issues/20#issuecomment-257399432
@Antonin: thanks. I've filed a feature-request here: crbug.com/661705. Feel free to star/discuss there
Sign in to add a comment