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

Side by Side Diff: third_party/WebKit/Source/core/css/RuleSet.cpp

Issue 2806003002: Verify that constant vectors aren't invalidated during iteration. (Closed)
Patch Set: Created 3 years, 8 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/MediaQueryEvaluator.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 void RuleSet::addRulesFromSheet(StyleSheetContents* sheet, 322 void RuleSet::addRulesFromSheet(StyleSheetContents* sheet,
323 const MediaQueryEvaluator& medium, 323 const MediaQueryEvaluator& medium,
324 AddRuleFlags addRuleFlags) { 324 AddRuleFlags addRuleFlags) {
325 TRACE_EVENT0("blink", "RuleSet::addRulesFromSheet"); 325 TRACE_EVENT0("blink", "RuleSet::addRulesFromSheet");
326 326
327 DCHECK(sheet); 327 DCHECK(sheet);
328 328
329 const HeapVector<Member<StyleRuleImport>>& importRules = sheet->importRules(); 329 const HeapVector<Member<StyleRuleImport>>& importRules = sheet->importRules();
330 for (unsigned i = 0; i < importRules.size(); ++i) { 330 for (unsigned i = 0; i < importRules.size(); ++i) {
331 StyleRuleImport* importRule = importRules[i].get(); 331 StyleRuleImport* importRule = importRules[i].get();
332 // TODO(sof): CHECK() added for crbug.com/699269 diagnosis, remove sooner.
333 CHECK_EQ(importRules.data(), sheet->importRules().data());
332 if (importRule->styleSheet() && 334 if (importRule->styleSheet() &&
333 (!importRule->mediaQueries() || 335 (!importRule->mediaQueries() ||
334 medium.eval(importRule->mediaQueries(), 336 medium.eval(importRule->mediaQueries(),
335 &m_features.viewportDependentMediaQueryResults(), 337 &m_features.viewportDependentMediaQueryResults(),
336 &m_features.deviceDependentMediaQueryResults()))) 338 &m_features.deviceDependentMediaQueryResults())))
337 addRulesFromSheet(importRule->styleSheet(), medium, addRuleFlags); 339 addRulesFromSheet(importRule->styleSheet(), medium, addRuleFlags);
338 } 340 }
339 341
340 addChildRules(sheet->childRules(), medium, addRuleFlags); 342 addChildRules(sheet->childRules(), medium, addRuleFlags);
341 } 343 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 429 }
428 430
429 #ifndef NDEBUG 431 #ifndef NDEBUG
430 void RuleSet::show() const { 432 void RuleSet::show() const {
431 for (const auto& rule : m_allRules) 433 for (const auto& rule : m_allRules)
432 rule.selector().show(); 434 rule.selector().show();
433 } 435 }
434 #endif 436 #endif
435 437
436 } // namespace blink 438 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698