| Index: Source/platform/LifecycleContext.h
|
| diff --git a/Source/platform/LifecycleContext.h b/Source/platform/LifecycleContext.h
|
| index d2eee95e45287eb6a63c2a09c35b9b384d67f8ea..2ffe89fd28fa8b0863a9f33e567bd790e7ff3ef7 100644
|
| --- a/Source/platform/LifecycleContext.h
|
| +++ b/Source/platform/LifecycleContext.h
|
| @@ -44,8 +44,16 @@ public:
|
| typedef LifecycleNotifier<T> Notifier;
|
| typedef LifecycleObserver<T> Observer;
|
|
|
| - LifecycleContext() { }
|
| - virtual ~LifecycleContext() { }
|
| + LifecycleContext()
|
| +#if ENABLE(ASSERT)
|
| + : m_contextDestroyed(false)
|
| +#endif
|
| + {
|
| + }
|
| + virtual ~LifecycleContext()
|
| + {
|
| + ASSERT(m_contextDestroyed);
|
| + }
|
|
|
| virtual bool isContextThread() const { return true; }
|
|
|
| @@ -59,11 +67,21 @@ public:
|
|
|
| protected:
|
| Notifier& lifecycleNotifier();
|
| + void contextDestroyed()
|
| + {
|
| +#if ENABLE(ASSERT)
|
| + ASSERT(!m_contextDestroyed);
|
| + m_contextDestroyed = true;
|
| +#endif
|
| + if (m_lifecycleNotifier)
|
| + m_lifecycleNotifier->contextDestroyed();
|
| + }
|
|
|
| private:
|
| PassOwnPtr<Notifier> createLifecycleNotifier();
|
|
|
| OwnPtr<Notifier> m_lifecycleNotifier;
|
| + bool m_contextDestroyed;
|
| };
|
|
|
| template<typename T>
|
|
|