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

Unified Diff: third_party/WebKit/Source/web/WebLeakDetector.cpp

Issue 2026993004: Delay leak reporting until worker in-process proxies have been finalized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drop back to ps#2 approach 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
« no previous file with comments | « third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebLeakDetector.cpp
diff --git a/third_party/WebKit/Source/web/WebLeakDetector.cpp b/third_party/WebKit/Source/web/WebLeakDetector.cpp
index c5a818ae5da8932d3c6153666239ae29fb22d030..95f2fdfa178dedd8df7b6362b9a4e30e8b8b2dbf 100644
--- a/third_party/WebKit/Source/web/WebLeakDetector.cpp
+++ b/third_party/WebKit/Source/web/WebLeakDetector.cpp
@@ -34,6 +34,7 @@
#include "core/editing/spellcheck/SpellChecker.h"
#include "core/fetch/MemoryCache.h"
#include "core/inspector/InstanceCounters.h"
+#include "core/workers/InProcessWorkerMessagingProxy.h"
#include "core/workers/WorkerThread.h"
#include "platform/Timer.h"
#include "public/web/WebFrame.h"
@@ -124,10 +125,19 @@ void WebLeakDetectorImpl::delayedGCAndReport(Timer<WebLeakDetectorImpl>*)
// Note: Oilpan precise GC is scheduled at the end of the event loop.
// Inspect counters on the next event loop.
- if (--m_numberOfGCNeeded)
+ if (--m_numberOfGCNeeded > 0) {
m_delayedGCAndReportTimer.startOneShot(0, BLINK_FROM_HERE);
- else
+ } else if (m_numberOfGCNeeded > -1 && InProcessWorkerMessagingProxy::proxyCount()) {
+ // It is possible that all posted tasks for finalizing in-process proxy objects
+ // will not have run before the final round of GCs started. If so, do yet
+ // another pass, letting these tasks run and then afterwards perform a GC to tidy up.
+ //
+ // TODO(sof): use proxyCount() to always decide if another GC needs to be scheduled.
+ // Some debug bots running browser unit tests disagree (crbug.com/616714)
+ m_delayedGCAndReportTimer.startOneShot(0, BLINK_FROM_HERE);
+ } else {
m_delayedReportTimer.startOneShot(0, BLINK_FROM_HERE);
+ }
}
void WebLeakDetectorImpl::delayedReport(Timer<WebLeakDetectorImpl>*)
« no previous file with comments | « third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698