MediaRecorder: Implements spontaneous stopping.

When all recorded tracks have ended, the MediaRecorder should spontaneously
stop and invoke onstop(), according to
https://www.w3.org/TR/mediastream-recording/#mediarecorder-methods.
This change implements this previously unimplemented feature.

Bug: 1013590,1035454
Change-Id: Ia96fa56f8ef20ff347822591c01703bfb276072b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1969577
Commit-Queue: Markus Handell <handellm@google.com>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729067}
15 files changed