Chromium Code Reviews| Index: Source/core/html/HTMLMediaElement.cpp |
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
| index a709141682132ddc3829fd251ecc4500baed28bc..ca1b4f06ccd03b8f77fe2b9a4e4f603d4710818a 100644 |
| --- a/Source/core/html/HTMLMediaElement.cpp |
| +++ b/Source/core/html/HTMLMediaElement.cpp |
| @@ -381,27 +381,14 @@ HTMLMediaElement::~HTMLMediaElement() |
| { |
| WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement(%p)", this); |
| -#if ENABLE(OILPAN) |
| - // If the HTMLMediaElement dies with the document we are not |
| - // allowed to touch the document to adjust delay load event counts |
| - // because the document could have been already |
| - // destructed. However, if the HTMLMediaElement dies with the |
| - // document there is no need to change the delayed load counts |
| - // because no load event will fire anyway. If the document is |
| - // still alive we do have to decrement the load delay counts. We |
| - // determine if the document is alive via the ActiveDOMObject |
| - // which is a context lifecycle observer. If the Document has been |
| - // destructed ActiveDOMObject::executionContext() returns 0. |
| - if (ActiveDOMObject::executionContext()) |
| - setShouldDelayLoadEvent(false); |
| -#else |
| + ASSERT(!m_shouldDelayLoadEvent); |
| + |
| +#if !ENABLE(OILPAN) |
| // HTMLMediaElement and m_asyncEventQueue always become unreachable |
| // together. So HTMLMediaElemenet and m_asyncEventQueue are destructed in |
| // the same GC. We don't need to close it explicitly in Oilpan. |
| m_asyncEventQueue->close(); |
| - setShouldDelayLoadEvent(false); |
| - |
| if (m_textTracks) |
| m_textTracks->clearOwner(); |
| m_audioTracks->shutdown(); |
| @@ -3468,7 +3455,28 @@ void HTMLMediaElement::stop() |
| bool HTMLMediaElement::hasPendingActivity() const |
|
scherkus (not reviewing)
2014/09/12 19:05:00
nice!
|
| { |
| - return (hasAudio() && isPlaying()) || m_asyncEventQueue->hasPendingEvents(); |
| + if (!document().isActive()) |
| + return false; |
| + |
| + if (m_shouldDelayLoadEvent) |
| + return true; |
| + |
| + if (m_networkState == NETWORK_LOADING) |
| + return true; |
| + |
| + if (potentiallyPlaying()) |
| + return true; |
| + |
| + if (m_seeking) |
| + return true; |
| + |
| + if (m_asyncEventQueue->hasPendingEvents()) |
| + return true; |
| + |
| + if (m_mediaSource) |
| + return true; |
| + |
| + return false; |
| } |
| void HTMLMediaElement::contextDestroyed() |