Chromium Code Reviews| Index: Source/core/html/HTMLMediaElement.cpp |
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
| index d09fcffdd02ef97ba9188668a525b48b85240c29..204afe904fa5d4cdb60077acfb7e723536ef7c65 100644 |
| --- a/Source/core/html/HTMLMediaElement.cpp |
| +++ b/Source/core/html/HTMLMediaElement.cpp |
| @@ -126,13 +126,8 @@ typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<HTMLMediaElement> > WeakMediaEl |
| typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<Document>, WeakMediaElementSet> DocumentElementSetMap; |
| static DocumentElementSetMap& documentToElementSetMap() |
| { |
| -#if ENABLE(OILPAN) |
| - DEFINE_STATIC_LOCAL(Persistent<DocumentElementSetMap>, map, (new DocumentElementSetMap())); |
| + DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<DocumentElementSetMap>, map, (adoptPtrWillBeNoop(new DocumentElementSetMap()))); |
| return *map; |
| -#else |
| - DEFINE_STATIC_LOCAL(DocumentElementSetMap, map, ()); |
| - return map; |
| -#endif |
| } |
| static void addElementToDocumentMap(HTMLMediaElement* element, Document* document) |
| @@ -318,11 +313,12 @@ HTMLMediaElement::~HTMLMediaElement() |
| // 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 by inspecting the weak |
| - // documentToElementSetMap. If the document is dead it has been |
| - // removed from the map during weak processing. |
| - if (documentToElementSetMap().contains(&document())) |
| + // 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()) { |
|
sof
2014/06/04 08:37:21
nit: braces seem superfluous.
Mads Ager (chromium)
2014/06/04 08:41:54
Removed. Thanks. :)
|
| setShouldDelayLoadEvent(false); |
| + } |
| #else |
| setShouldDelayLoadEvent(false); |
| #endif |