Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(965)

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 310333003: Oilpan: Remove ~HTMLMediaElement document access when the document is destructed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove braces. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index d09fcffdd02ef97ba9188668a525b48b85240c29..74dfb53f160b0c74e95937caca92051c4002c4e7 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,10 +313,10 @@ 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())
setShouldDelayLoadEvent(false);
#else
setShouldDelayLoadEvent(false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698