From d42889818998d4428a2f1c045ba0279edfa08723 Mon Sep 17 00:00:00 2001 From: hajimehoshi Date: Fri, 10 Jul 2015 05:00:42 -0700 Subject: [PATCH] Add support for V8PerContextData to the leak detector (Chromium side) BUG=506466 Review URL: https://codereview.chromium.org/1227293002 Cr-Commit-Position: refs/heads/master@{#338279} --- content/shell/renderer/layout_test/leak_detector.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/content/shell/renderer/layout_test/leak_detector.cc b/content/shell/renderer/layout_test/leak_detector.cc index a057563f82a3..e2e9abde9abc 100644 --- a/content/shell/renderer/layout_test/leak_detector.cc +++ b/content/shell/renderer/layout_test/leak_detector.cc @@ -28,6 +28,7 @@ const int kInitialNumberOfLiveRenderObjects = 3; const int kInitialNumberOfLiveResources = 0; const int kInitialNumberOfScriptPromises = 0; const int kInitialNumberOfLiveFrames = 1; +const int kInitialNumberOfV8PerContextData = 1; // In the initial state, there are two ActiveDOMObjects (FontFaceSet created by // HTMLDocument and SuspendableTimer created by DocumentLoader). @@ -46,6 +47,8 @@ LeakDetector::LeakDetector(BlinkTestRunner* test_runner) kInitialNumberOfLiveActiveDOMObject; previous_result_.numberOfLiveScriptPromises = kInitialNumberOfScriptPromises; previous_result_.numberOfLiveFrames = kInitialNumberOfLiveFrames; + previous_result_.numberOfLiveV8PerContextData = + kInitialNumberOfV8PerContextData; } LeakDetector::~LeakDetector() { @@ -112,6 +115,13 @@ void LeakDetector::onLeakDetectionComplete( list->AppendInteger(result.numberOfLiveFrames); detail.Set("numberOfLiveFrames", list); } + if (previous_result_.numberOfLiveV8PerContextData < + result.numberOfLiveV8PerContextData) { + base::ListValue* list = new base::ListValue(); + list->AppendInteger(previous_result_.numberOfLiveV8PerContextData); + list->AppendInteger(result.numberOfLiveV8PerContextData); + detail.Set("numberOfLiveV8PerContextData", list); + } if (!detail.empty()) { std::string detail_str; -- 2.11.4.GIT