Ensure that hasPendingActivity() is false for stopped media elements

Where stopped means that ActiveDOMObject::stop() has been called.

All the conditions in hasPendingActivity() are now false after stop():

 - m_shouldDelayLoadEvent is set to false by userCancelledLoad() ->
   setShouldDelayLoadEvent(false).

 - m_networkState is either NETWORK_EMPTY or NETWORK_IDLE after
   userCancelledLoad().

 - couldPlayEnoughData() returns false because m_paused is now set to
   true by stop().

 - m_seeking is now set to false by stop().

 - m_mediaSource is set to null by userCancelledLoad() ->
   closeMediaSource().

 - m_asyncEventQueue->hasPendingEvents() is false because stop() calls
   m_asyncEventQueue->close().

TEST=LayoutTests/media/gc-pending-event-inactive-document.html

This test reliably hits the assert that revealed this problem:
https://codereview.chromium.org/584633004

BUG=400659

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

git-svn-id: svn://svn.chromium.org/blink/trunk@182332 bbb929c8-8fbe-4397-9dbb-9b2b20218538
2 files changed
tree: 3630aacd9f2ce1c0b8543b961c056cd2cae00097
  1. third_party/