Fix memory leak caused by using SVG in the UA stylesheet
The leak detector (enabled by --enable-leak-detection) complains because the SVG images created and owned by the UA style sheet are not free'ed at the end of the tests but it's expected because the UA style sheet is a singleton (DEFINE_STATIC_LOCAL) and the SVG images will never be free'ed while a renderer is alive. Since the leak detector is not interested in anything referenced from CSSDefaultStyleSheets [1], this CL addresses the leak by re-creating the default style sheet in CSSDefaultStyleSheets::PrepareForLeakDetection to clean up the SVG resources before the leak detection. This CL also sets flattenhtml=true for IDR_UASTYLE_THEME_CONTROLS_REFRESH_CSS, which was reverted by [2] due to the memory leak. (The reverted CL [3] will be re-landed in a separate CL) TestExpectations is also updated to re-enable password tests which was disabled due to the memory leak. [1] discussion on memory-dev: https://groups.google.com/a/chromium.org/d/topic/memory-dev/LwiD2RBqUpg/discussion [2] https://chromium-review.googlesource.com/c/chromium/src/+/1722789 [3] https://chromium-review.googlesource.com/c/chromium/src/+/1716161 Bug: 988232 Change-Id: I2f289e90f7c16cfe23f501ddc19ea219be7c5bbb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772657 Commit-Queue: Alex Keng <shihken@microsoft.com> Reviewed-by:Kent Tamura <tkent@chromium.org> Reviewed-by:
Keishi Hattori <keishi@chromium.org> Cr-Commit-Position: refs/heads/master@{#690814}
Showing
Please register or sign in to comment