| OLD | NEW |
| 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 13 matching lines...) Expand all Loading... |
| 24 const int kInitialNumberOfLiveAudioNodes = 0; | 24 const int kInitialNumberOfLiveAudioNodes = 0; |
| 25 const int kInitialNumberOfLiveDocuments = 1; | 25 const int kInitialNumberOfLiveDocuments = 1; |
| 26 const int kInitialNumberOfLiveNodes = 4; | 26 const int kInitialNumberOfLiveNodes = 4; |
| 27 const int kInitialNumberOfLiveLayoutObjects = 3; | 27 const int kInitialNumberOfLiveLayoutObjects = 3; |
| 28 const int kInitialNumberOfLiveResources = 0; | 28 const int kInitialNumberOfLiveResources = 0; |
| 29 const int kInitialNumberOfScriptPromises = 0; | 29 const int kInitialNumberOfScriptPromises = 0; |
| 30 const int kInitialNumberOfLiveFrames = 1; | 30 const int kInitialNumberOfLiveFrames = 1; |
| 31 const int kInitialNumberOfWorkerGlobalScopes = 0; | 31 const int kInitialNumberOfWorkerGlobalScopes = 0; |
| 32 | 32 |
| 33 // In the initial state, there are two ActiveDOMObjects (FontFaceSet created by | 33 // In the initial state, there are two ActiveDOMObjects (FontFaceSet created by |
| 34 // HTMLDocument and SuspendableTimer created by DocumentLoader). | 34 // HTMLDocument and SuspendableTimer created by DocumentLoader). A third one |
| 35 const int kInitialNumberOfLiveActiveDOMObject = 2; | 35 // (IntersectionObserverController) may be created if the root document |
| 36 // registers an intersection observer. |
| 37 const int kInitialNumberOfLiveActiveDOMObject = 3; |
| 36 | 38 |
| 37 // This includes not only about:blank's context but also ScriptRegexp (e.g. | 39 // This includes not only about:blank's context but also ScriptRegexp (e.g. |
| 38 // created by isValidEmailAddress in EmailInputType.cpp). The leak detector | 40 // created by isValidEmailAddress in EmailInputType.cpp). The leak detector |
| 39 // always creates the latter to stabilize the number of V8PerContextData | 41 // always creates the latter to stabilize the number of V8PerContextData |
| 40 // objects. | 42 // objects. |
| 41 const int kInitialNumberOfV8PerContextData = 2; | 43 const int kInitialNumberOfV8PerContextData = 2; |
| 42 | 44 |
| 43 LeakDetector::LeakDetector(BlinkTestRunner* test_runner) | 45 LeakDetector::LeakDetector(BlinkTestRunner* test_runner) |
| 44 : test_runner_(test_runner), | 46 : test_runner_(test_runner), |
| 45 web_leak_detector_(blink::WebLeakDetector::create(this)) { | 47 web_leak_detector_(blink::WebLeakDetector::create(this)) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 base::JSONWriter::Write(detail, &detail_str); | 146 base::JSONWriter::Write(detail, &detail_str); |
| 145 report.detail = detail_str; | 147 report.detail = detail_str; |
| 146 report.leaked = true; | 148 report.leaked = true; |
| 147 } | 149 } |
| 148 | 150 |
| 149 previous_result_ = result; | 151 previous_result_ = result; |
| 150 test_runner_->ReportLeakDetectionResult(report); | 152 test_runner_->ReportLeakDetectionResult(report); |
| 151 } | 153 } |
| 152 | 154 |
| 153 } // namespace content | 155 } // namespace content |
| OLD | NEW |