Prevent more script-observable cases of HTMLMediaElement GC

This is intended to cover all cases where Gecko prevents GC:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26515#c5

Additionally, change the behavior for MediaSource so that an
HTMLMediaElement attached to a MediaSource is never collected. Since the
reverse is also true (see MediaSource::hasPendingActivity) a connected
media element + media source pair will now live as long as the document.

LayoutTests for the new cases in HTMLMediaElement::hasPendingActivity()
were added:

media/gc-while-delaying-the-load-event.html (was timeout)
http/tests/media/gc-while-network-loading.html (was timeout)
media/gc-while-playing.html (was pass)
media/gc-while-seeking.html (was timeout)
http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html (was failure)

BUG=400659

Review URL: https://codereview.chromium.org/552303006

git-svn-id: svn://svn.chromium.org/blink/trunk@182247 bbb929c8-8fbe-4397-9dbb-9b2b20218538
18 files changed
tree: 612b71019793de988e41f62877251046a3d59826
  1. third_party/