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

Unified Diff: third_party/WebKit/Source/platform/LifecycleNotifier.h

Issue 2367753002: Reland of Clear LifecycleObserver::m_context when LifecycleObserver::contextDestroyed gets called (Closed)
Patch Set: Created 4 years, 3 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
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 c38d3da0f4337329c21b26c664667324a8b7f593..e03351d51d1eb1e5f8a92db877c7dadab1615a62 100644
--- a/third_party/WebKit/Source/platform/LifecycleNotifier.h
+++ b/third_party/WebKit/Source/platform/LifecycleNotifier.h
@@ -61,9 +61,7 @@
{
}
-#if DCHECK_IS_ON()
T* context() { return static_cast<T*>(this); }
-#endif
using ObserverSet = HeapHashSet<WeakMember<Observer>>;
@@ -98,8 +96,9 @@
ObserverSet observers;
m_observers.swap(observers);
for (Observer* observer : observers) {
- ASSERT(observer->lifecycleContext() == context());
+ DCHECK(observer->lifecycleContext() == context());
observer->contextDestroyed();
+ observer->clearContext();
}
}
« no previous file with comments | « third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp ('k') | third_party/WebKit/Source/platform/LifecycleObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698