Index: Source/core/dom/DocumentLifecycleNotifier.cpp |
diff --git a/Source/core/dom/DocumentLifecycleNotifier.cpp b/Source/core/dom/DocumentLifecycleNotifier.cpp |
index 39a4c2d47d9d424537556e26fefb62763bf9358c..7a6fbde93ed8cc165888963ea39b93e2914e49a6 100644 |
--- a/Source/core/dom/DocumentLifecycleNotifier.cpp |
+++ b/Source/core/dom/DocumentLifecycleNotifier.cpp |
@@ -28,47 +28,36 @@ |
#include "core/dom/DocumentLifecycleNotifier.h" |
#include "core/dom/DocumentLifecycleObserver.h" |
-#include "wtf/Assertions.h" |
namespace blink { |
DocumentLifecycleNotifier::DocumentLifecycleNotifier(Document* document) |
- : LifecycleNotifier<Document>(document) |
+ : LifecycleNotifier<Document, DocumentLifecycleObserver>(document) |
{ |
} |
-void DocumentLifecycleNotifier::addObserver(DocumentLifecycleNotifier::Observer* observer) |
+void DocumentLifecycleNotifier::addObserver(DocumentLifecycleObserver* observer) |
{ |
- if (observer->observerType() == Observer::DocumentLifecycleObserverType) { |
- RELEASE_ASSERT(m_iterating != IteratingOverDocumentObservers); |
- m_documentObservers.add(static_cast<DocumentLifecycleObserver*>(observer)); |
- } |
- |
- LifecycleNotifier<Document>::addObserver(observer); |
+ LifecycleNotifier<Document, DocumentLifecycleObserver>::addObserver(observer); |
} |
-void DocumentLifecycleNotifier::removeObserver(DocumentLifecycleNotifier::Observer* observer) |
+void DocumentLifecycleNotifier::removeObserver(DocumentLifecycleObserver* observer) |
{ |
- if (observer->observerType() == Observer::DocumentLifecycleObserverType) { |
- RELEASE_ASSERT(m_iterating != IteratingOverDocumentObservers); |
- m_documentObservers.remove(static_cast<DocumentLifecycleObserver*>(observer)); |
- } |
- |
- LifecycleNotifier<Document>::removeObserver(observer); |
+ LifecycleNotifier<Document, DocumentLifecycleObserver>::removeObserver(observer); |
} |
void DocumentLifecycleNotifier::notifyDocumentWasDetached() |
{ |
- TemporaryChange<IterationType> scope(m_iterating, IteratingOverDocumentObservers); |
- for (DocumentLifecycleObserver* observer : m_documentObservers) |
+ TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
+ for (DocumentLifecycleObserver* observer : m_observers) |
observer->documentWasDetached(); |
} |
#if !ENABLE(OILPAN) |
void DocumentLifecycleNotifier::notifyDocumentWasDisposed() |
{ |
- TemporaryChange<IterationType> scope(m_iterating, IteratingOverDocumentObservers); |
- for (DocumentLifecycleObserver* observer : m_documentObservers) |
+ TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
+ for (DocumentLifecycleObserver* observer : m_observers) |
observer->documentWasDisposed(); |
} |
#endif |