Index: third_party/WebKit/Source/platform/LifecycleNotifier.h |
diff --git a/third_party/WebKit/Source/platform/LifecycleNotifier.h b/third_party/WebKit/Source/platform/LifecycleNotifier.h |
index d3a30896905d91f97a88a483344259de873ed52f..b891c09db4601458ce5db580240c46d48bf03822 100644 |
--- a/third_party/WebKit/Source/platform/LifecycleNotifier.h |
+++ b/third_party/WebKit/Source/platform/LifecycleNotifier.h |
@@ -60,7 +60,6 @@ public: |
protected: |
LifecycleNotifier() |
: m_iterating(IteratingNone) |
- , m_didCallContextDestroyed(false) |
{ |
} |
@@ -79,16 +78,13 @@ protected: |
#if ENABLE(ASSERT) |
T* context() { return static_cast<T*>(this); } |
#endif |
- |
-private: |
- bool m_didCallContextDestroyed; |
}; |
template<typename T, typename Observer> |
inline LifecycleNotifier<T, Observer>::~LifecycleNotifier() |
{ |
// FIXME: Enable the following ASSERT. Also see a FIXME in Document::detach(). |
- // ASSERT(!m_observers.size() || m_didCallContextDestroyed); |
+ // ASSERT(!m_observers.size()); |
#if !ENABLE(OILPAN) |
TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
@@ -102,7 +98,7 @@ template<typename T, typename Observer> |
inline void LifecycleNotifier<T, Observer>::notifyContextDestroyed() |
{ |
// Don't notify contextDestroyed() twice. |
- if (m_didCallContextDestroyed) |
+ if (m_observers.isEmpty()) |
return; |
TemporaryChange<IterationType> scope(m_iterating, IteratingOverAll); |
@@ -119,10 +115,10 @@ inline void LifecycleNotifier<T, Observer>::notifyContextDestroyed() |
if (m_observers.contains(observer)) { |
ASSERT(observer->lifecycleContext() == context()); |
observer->contextDestroyed(); |
+ observer->clearLifecycleContext(); |
} |
} |
- |
- m_didCallContextDestroyed = true; |
+ m_observers.clear(); |
} |
template<typename T, typename Observer> |