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

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

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: call clearScriptRegexpContext() in prepareForLeakDetection() 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
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 e1ddecbab86bf329b6cd9c60d7956be2f3b50bd0..54c16242e9826b7459cf8f1f0f1d377faff17104 100644
--- a/third_party/WebKit/Source/web/WebLeakDetector.cpp
+++ b/third_party/WebKit/Source/web/WebLeakDetector.cpp
@@ -65,7 +65,8 @@ public:
~WebLeakDetectorImpl() override {}
- void collectGarbageAndGetDOMCounts(WebLocalFrame*) override;
+ void prepareForLeakDetection(WebLocalFrame*) override;
+ void collectGarbageAndReport() override;
private:
void delayedGCAndReport(Timer<WebLeakDetectorImpl>*);
@@ -77,7 +78,7 @@ private:
int m_numberOfGCNeeded;
};
-void WebLeakDetectorImpl::collectGarbageAndGetDOMCounts(WebLocalFrame* frame)
+void WebLeakDetectorImpl::prepareForLeakDetection(WebLocalFrame* frame)
{
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handleScope(isolate);
@@ -100,10 +101,13 @@ void WebLeakDetectorImpl::collectGarbageAndGetDOMCounts(WebLocalFrame* frame)
// FIXME: HTML5 Notification should be closed because notification affects the result of number of DOM objects.
- V8GCController::collectAllGarbageForTesting(isolate);
- // Note: Oilpan precise GC is scheduled at the end of the event loop.
-
V8PerIsolateData::from(isolate)->clearScriptRegexpContext();
+}
+
+void WebLeakDetectorImpl::collectGarbageAndReport()
+{
+ V8GCController::collectAllGarbageForTesting(V8PerIsolateData::mainThreadIsolate());
+ // Note: Oilpan precise GC is scheduled at the end of the event loop.
// Task queue may contain delayed object destruction tasks.
// This method is called from navigation hook inside FrameLoader,
« no previous file with comments | « content/shell/renderer/layout_test/leak_detector.cc ('k') | third_party/WebKit/public/web/WebLeakDetector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698