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

Side by Side Diff: content/shell/renderer/layout_test/leak_detector.cc

Issue 1715203002: Stop async spellchecker before running the leak detector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + parameterize WebLeakDetector over WebFrames instead Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/renderer/layout_test/leak_detector.h" 5 #include "content/shell/renderer/layout_test/leak_detector.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/shell/renderer/layout_test/blink_test_runner.h" 10 #include "content/shell/renderer/layout_test/blink_test_runner.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 kInitialNumberOfLiveActiveDOMObject; 52 kInitialNumberOfLiveActiveDOMObject;
53 previous_result_.numberOfLiveScriptPromises = kInitialNumberOfScriptPromises; 53 previous_result_.numberOfLiveScriptPromises = kInitialNumberOfScriptPromises;
54 previous_result_.numberOfLiveFrames = kInitialNumberOfLiveFrames; 54 previous_result_.numberOfLiveFrames = kInitialNumberOfLiveFrames;
55 previous_result_.numberOfLiveV8PerContextData = 55 previous_result_.numberOfLiveV8PerContextData =
56 kInitialNumberOfV8PerContextData; 56 kInitialNumberOfV8PerContextData;
57 } 57 }
58 58
59 LeakDetector::~LeakDetector() { 59 LeakDetector::~LeakDetector() {
60 } 60 }
61 61
62 void LeakDetector::TryLeakDetection(blink::WebLocalFrame* frame) { 62 void LeakDetector::TryLeakDetection(blink::WebFrame* frame) {
63 web_leak_detector_->prepareForLeakDetection(); 63 web_leak_detector_->prepareForLeakDetection(frame);
64 web_leak_detector_->collectGarbageAndReport(); 64 web_leak_detector_->collectGarbageAndReport();
65 } 65 }
66 66
67 void LeakDetector::onLeakDetectionComplete( 67 void LeakDetector::onLeakDetectionComplete(
68 const WebLeakDetectorClient::Result& result) { 68 const WebLeakDetectorClient::Result& result) {
69 LeakDetectionResult report; 69 LeakDetectionResult report;
70 report.leaked = false; 70 report.leaked = false;
71 base::DictionaryValue detail; 71 base::DictionaryValue detail;
72 72
73 if (previous_result_.numberOfLiveAudioNodes < result.numberOfLiveAudioNodes) { 73 if (previous_result_.numberOfLiveAudioNodes < result.numberOfLiveAudioNodes) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 base::JSONWriter::Write(detail, &detail_str); 134 base::JSONWriter::Write(detail, &detail_str);
135 report.detail = detail_str; 135 report.detail = detail_str;
136 report.leaked = true; 136 report.leaked = true;
137 } 137 }
138 138
139 previous_result_ = result; 139 previous_result_ = result;
140 test_runner_->ReportLeakDetectionResult(report); 140 test_runner_->ReportLeakDetectionResult(report);
141 } 141 }
142 142
143 } // namespace content 143 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698