Web Inspector: race between frontend and backend both starting timeline recordings...
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 May 2016 19:29:14 +0000 (19:29 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 May 2016 19:29:14 +0000 (19:29 +0000)
commitda26fd6615836d975af4d00c919bc68b8e042893
tree8d47da4da3dc60090419674a54275a3a83446cb0
parentf8326a69d6434aaa3d1afc8d8b36362fe41db9cf
Web Inspector: race between frontend and backend both starting timeline recordings causes console assert
https://bugs.webkit.org/show_bug.cgi?id=157850
<rdar://problem/26349229>

Reviewed by Joseph Pecoraro.

If TimelineManager has created a fresh recording and the Timeline.autoCaptureStarted
event comes before Timeline.recordingStarted, then the manager will try to start the
same recording twice. In this scenario, the manager should just wait until the
Timeline.recordingStarted event comes, since it causes TimelineMangare to set up
the isCapturing flag and other state.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.prototype.startCapturing):
(WebInspector.TimelineManager.prototype.capturingStarted):
(WebInspector.TimelineManager.prototype.autoCaptureStarted):
Add a new flag, this._waitingForCapturingStartedEvent. If true, don't start the
recording in response to this event.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@201092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js