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

Unified Diff: third_party/WebKit/public/web/WebLeakDetector.h

Issue 1472943004: Split up leak detector into two stages for better leak reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rephrase WebLeakDetector as two-phased Created 5 years, 1 month 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/web/WebLeakDetector.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/public/web/WebLeakDetector.h
diff --git a/third_party/WebKit/public/web/WebLeakDetector.h b/third_party/WebKit/public/web/WebLeakDetector.h
index 4f65d92a85a78d6444d21c2e9b133783ecb8469c..bf8a5c4e128564be7e22f94d75c858e0b7063630 100644
--- a/third_party/WebKit/public/web/WebLeakDetector.h
+++ b/third_party/WebKit/public/web/WebLeakDetector.h
@@ -53,15 +53,36 @@ public:
virtual void onLeakDetectionComplete(const Result&) = 0;
};
+// |WebLeakDetector| detects leaks of various Blink objects, counting
+// the ones remaining after having reset Blink's global state and
+// collected all garbage. See |WebLeakDetectorClient::Results|
+// for the kinds of objects supported.
class WebLeakDetector {
public:
virtual ~WebLeakDetector() { }
BLINK_EXPORT static WebLeakDetector* create(WebLeakDetectorClient*);
- // Cleans up the DOM objects and counts them. |WebLeakDetectorClient::onLeakDetectionComplete()| is called when done.
- // This is supposed to be used for detecting DOM-object leaks.
+ // Leak detection can either be performed in one go using
+ // |collectGarbageAndGetDOMCounts()| or in two separate
+ // stages (|prepareForLeakDetection()|, |collectGarbageAndReport()|).
+ //
+ // The latter option giving you the opportunity to perform
+ // additional releasing of resources in between the two
+ // stages, should you need it.
+
+ // The all-in-one-go option, performing the |prepareForLeakDetection()|
+ // and |collectGarbageAndReport()| stages in sequence.
virtual void collectGarbageAndGetDOMCounts(WebLocalFrame*) = 0;
haraken 2015/11/25 08:16:30 There is only one call site of collectGarbageAndGe
sof 2015/11/25 08:40:21 Done, retired collectGarbageAndGetDOMCounts() + sy
+
+ // Perform initial stage of preparing for leak detection,
+ // releasing references to resources held globally.
+ virtual void prepareForLeakDetection(WebLocalFrame*) = 0;
+
+ // Garbage collect Blink's heaps and report leak counts.
+ // |WebLeakDetectorClient::onLeakDetectionComplete()| is called
+ // upon completion.
+ virtual void collectGarbageAndReport() = 0;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/web/WebLeakDetector.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698