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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 1555993002: Reduce risk of MediaQueryEvaluator-induced leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index 92e8830a36bec9c65a8106c62c249708ae7c0247..f7e83a88fd10023bf58cf19b8e6655312c8fac2a 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -150,10 +150,10 @@ StyleResolver::StyleResolver(Document& document)
{
FrameView* view = document.view();
if (view) {
- m_medium = adoptPtr(new MediaQueryEvaluator(&view->frame()));
+ m_medium = adoptPtrWillBeNoop(new MediaQueryEvaluator(&view->frame()));
m_printMediaType = equalIgnoringCase(view->mediaType(), MediaTypeNames::print);
} else {
- m_medium = adoptPtr(new MediaQueryEvaluator("all"));
+ m_medium = adoptPtrWillBeNoop(new MediaQueryEvaluator("all"));
}
initWatchedSelectorRules();
@@ -1548,6 +1548,7 @@ DEFINE_TRACE(StyleResolver)
{
#if ENABLE(OILPAN)
visitor->trace(m_matchedPropertiesCache);
+ visitor->trace(m_medium);
visitor->trace(m_viewportDependentMediaQueryResults);
visitor->trace(m_selectorFilter);
visitor->trace(m_viewportStyleResolver);

Powered by Google App Engine
This is Rietveld 408576698