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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.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/page/TouchDisambiguation.cpp ('k') | Source/core/rendering/FastTextAutosizer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 01b6750cd13e2050d612d6addfdd49b1ea265f0e..76571fb19d2d4e2d7dda439c9161f63f285b1544 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -285,7 +285,7 @@ static void setupScrollbarLayer(GraphicsLayer* scrollbarGraphicsLayer, WebScroll
WebScrollbarLayer* ScrollingCoordinator::addWebScrollbarLayer(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, PassOwnPtr<blink::WebScrollbarLayer> scrollbarLayer)
{
ScrollbarMap& scrollbars = orientation == HorizontalScrollbar ? m_horizontalScrollbars : m_verticalScrollbars;
- return scrollbars.add(scrollableArea, scrollbarLayer).iterator->value.get();
+ return scrollbars.add(scrollableArea, scrollbarLayer).storedValue->value.get();
}
WebScrollbarLayer* ScrollingCoordinator::getWebScrollbarLayer(ScrollableArea* scrollableArea, ScrollbarOrientation orientation)
@@ -395,8 +395,9 @@ static void makeLayerChildFrameMap(const Frame* currentFrame, LayerFrameMap* map
const RenderLayer* containingLayer = child->ownerRenderer()->enclosingLayer();
LayerFrameMap::iterator iter = map->find(containingLayer);
if (iter == map->end())
- iter = map->add(containingLayer, Vector<const Frame*>()).iterator;
- iter->value.append(child);
+ map->add(containingLayer, Vector<const Frame*>()).storedValue->value.append(child);
+ else
+ iter->value.append(child);
}
}
@@ -430,8 +431,11 @@ static void convertLayerRectsToEnclosingCompositedLayerRecursive(
}
LayerHitTestRects::iterator compIter = compositorRects.find(compositedLayer);
+ Vector<LayoutRect>* compIterValue;
if (compIter == compositorRects.end())
- compIter = compositorRects.add(compositedLayer, Vector<LayoutRect>()).iterator;
+ compIterValue = &compositorRects.add(compositedLayer, Vector<LayoutRect>()).storedValue->value;
+ else
+ compIterValue = &compIter->value;
// Transform each rect to the co-ordinate space of it's enclosing composited layer.
for (size_t i = 0; i < layerIter->value.size(); ++i) {
LayoutRect rect = layerIter->value[i];
@@ -444,7 +448,7 @@ static void convertLayerRectsToEnclosingCompositedLayerRecursive(
if (compositedLayer->renderer()->hasOverflowClip())
rect.move(compositedLayer->renderBox()->scrolledContentOffset());
}
- compIter->value.append(rect);
+ compIterValue->append(rect);
}
}
« no previous file with comments | « Source/core/page/TouchDisambiguation.cpp ('k') | Source/core/rendering/FastTextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698