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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.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, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 break; 1295 break;
1296 } 1296 }
1297 1297
1298 const MediaQuerySet* queries = media->queries(); 1298 const MediaQuerySet* queries = media->queries();
1299 const WillBeHeapVector<OwnPtrWillBeMember<MediaQuery> >& queryVector = queri es->queryVector(); 1299 const WillBeHeapVector<OwnPtrWillBeMember<MediaQuery> >& queryVector = queri es->queryVector();
1300 LocalFrame* frame = nullptr; 1300 LocalFrame* frame = nullptr;
1301 if (parentStyleSheet) { 1301 if (parentStyleSheet) {
1302 if (Document* document = parentStyleSheet->ownerDocument()) 1302 if (Document* document = parentStyleSheet->ownerDocument())
1303 frame = document->frame(); 1303 frame = document->frame();
1304 } 1304 }
1305 OwnPtr<MediaQueryEvaluator> mediaEvaluator = adoptPtr(new MediaQueryEvaluato r(frame)); 1305 OwnPtrWillBeRawPtr<MediaQueryEvaluator> mediaEvaluator = adoptPtrWillBeNoop( new MediaQueryEvaluator(frame));
1306 1306
1307 InspectorStyleSheet* inspectorStyleSheet = parentStyleSheet ? m_cssStyleShee tToInspectorStyleSheet.get(parentStyleSheet) : nullptr; 1307 InspectorStyleSheet* inspectorStyleSheet = parentStyleSheet ? m_cssStyleShee tToInspectorStyleSheet.get(parentStyleSheet) : nullptr;
1308 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::MediaQuery> > mediaListArray = T ypeBuilder::Array<TypeBuilder::CSS::MediaQuery>::create(); 1308 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::MediaQuery> > mediaListArray = T ypeBuilder::Array<TypeBuilder::CSS::MediaQuery>::create();
1309 RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValues::createDynamicIfFr ameExists(frame); 1309 RefPtrWillBeRawPtr<MediaValues> mediaValues = MediaValues::createDynamicIfFr ameExists(frame);
1310 bool hasMediaQueryItems = false; 1310 bool hasMediaQueryItems = false;
1311 for (size_t i = 0; i < queryVector.size(); ++i) { 1311 for (size_t i = 0; i < queryVector.size(); ++i) {
1312 MediaQuery* query = queryVector.at(i).get(); 1312 MediaQuery* query = queryVector.at(i).get();
1313 const ExpressionHeapVector& expressions = query->expressions(); 1313 const ExpressionHeapVector& expressions = query->expressions();
1314 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::MediaQueryExpression> > expr essionArray = TypeBuilder::Array<TypeBuilder::CSS::MediaQueryExpression>::create (); 1314 RefPtr<TypeBuilder::Array<TypeBuilder::CSS::MediaQueryExpression> > expr essionArray = TypeBuilder::Array<TypeBuilder::CSS::MediaQueryExpression>::create ();
1315 bool hasExpressionItems = false; 1315 bool hasExpressionItems = false;
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 visitor->trace(m_documentToCSSStyleSheets); 2002 visitor->trace(m_documentToCSSStyleSheets);
2003 visitor->trace(m_invalidatedDocuments); 2003 visitor->trace(m_invalidatedDocuments);
2004 visitor->trace(m_nodeToInspectorStyleSheet); 2004 visitor->trace(m_nodeToInspectorStyleSheet);
2005 visitor->trace(m_documentToViaInspectorStyleSheet); 2005 visitor->trace(m_documentToViaInspectorStyleSheet);
2006 #endif 2006 #endif
2007 visitor->trace(m_inspectorUserAgentStyleSheet); 2007 visitor->trace(m_inspectorUserAgentStyleSheet);
2008 InspectorBaseAgent::trace(visitor); 2008 InspectorBaseAgent::trace(visitor);
2009 } 2009 }
2010 2010
2011 } // namespace blink 2011 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698