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

Unified Diff: Source/core/dom/StyleEngine.cpp

Issue 167123002: Simpler return value from HashTable::add()/HashMap::add() and others (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/core/dom/SpaceSplitString.cpp ('k') | Source/core/dom/custom/CustomElementScheduler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleEngine.cpp
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index 0ff80095c06339cf162bdc730520c7571fa9cf92..5a4f467ff12e23a5976381947fcfb33dcb8d5990 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -146,8 +146,8 @@ TreeScopeStyleSheetCollection* StyleEngine::ensureStyleSheetCollectionFor(TreeSc
HashMap<TreeScope*, OwnPtr<TreeScopeStyleSheetCollection> >::AddResult result = m_styleSheetCollectionMap.add(&treeScope, nullptr);
if (result.isNewEntry)
- result.iterator->value = adoptPtr(new ShadowTreeStyleSheetCollection(toShadowRoot(treeScope)));
- return result.iterator->value.get();
+ result.storedValue->value = adoptPtr(new ShadowTreeStyleSheetCollection(toShadowRoot(treeScope)));
+ return result.storedValue->value.get();
}
TreeScopeStyleSheetCollection* StyleEngine::styleSheetCollectionFor(TreeScope& treeScope)
@@ -568,15 +568,15 @@ PassRefPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& tex
AtomicString textContent(text);
HashMap<AtomicString, StyleSheetContents*>::AddResult result = textToSheetCache().add(textContent, 0);
- if (result.isNewEntry || !result.iterator->value) {
+ if (result.isNewEntry || !result.storedValue->value) {
styleSheet = StyleEngine::parseSheet(e, text, startPosition, createdByParser);
if (result.isNewEntry && styleSheet->contents()->maybeCacheable()) {
- result.iterator->value = styleSheet->contents();
+ result.storedValue->value = styleSheet->contents();
sheetToTextCache().add(styleSheet->contents(), textContent);
}
} else {
- ASSERT(result.iterator->value->maybeCacheable());
- styleSheet = CSSStyleSheet::createInline(result.iterator->value, e, startPosition);
+ ASSERT(result.storedValue->value->maybeCacheable());
+ styleSheet = CSSStyleSheet::createInline(result.storedValue->value, e, startPosition);
}
} else {
// FIXME: currently we don't cache StyleSheetContents inQuirksMode.
« no previous file with comments | « Source/core/dom/SpaceSplitString.cpp ('k') | Source/core/dom/custom/CustomElementScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698