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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceBase.cpp

Issue 1945953002: Fix an edge case where early disconnect() can omit delivering of observation. crbug/607324 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing CORE_EXPORT to PerformanceObserver class Created 4 years, 7 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/core/timing/PerformanceBase.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
index f48991b039240fe19ca480552461236ebabc84d6..1c5fb3d84657a04bc2e19f2a783c6f78b93ea257 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -352,6 +352,12 @@ void PerformanceBase::registerPerformanceObserver(PerformanceObserver& observer)
void PerformanceBase::unregisterPerformanceObserver(PerformanceObserver& oldObserver)
{
+ ASSERT(isMainThread());
+ // Deliver any pending observations on this observer before unregistering.
+ if (m_activeObservers.contains(&oldObserver) && !oldObserver.shouldBeSuspended()) {
+ oldObserver.deliver();
+ m_activeObservers.remove(&oldObserver);
+ }
m_observers.remove(&oldObserver);
updatePerformanceObserverFilterOptions();
}
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698