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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 212813004: HashMap misuse in ScrollingCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | 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 6147b1228d0c4cef0c9d456665edb1c57156e3e2..1ec95d151c0351b20ed15d051bc58a33fa99d762 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -392,12 +392,13 @@ static void makeLayerChildFrameMap(const LocalFrame* currentFrame, LayerFrameMap
map->clear();
const FrameTree& tree = currentFrame->tree();
for (const LocalFrame* child = tree.firstChild(); child; child = child->tree().nextSibling()) {
- const RenderLayer* containingLayer = child->ownerRenderer()->enclosingLayer();
- LayerFrameMap::iterator iter = map->find(containingLayer);
- if (iter == map->end())
- map->add(containingLayer, Vector<const LocalFrame*>()).storedValue->value.append(child);
- else
- iter->value.append(child);
+ if (const RenderLayer* containingLayer = child->ownerRenderer()->enclosingLayer()) {
+ LayerFrameMap::iterator iter = map->find(containingLayer);
+ if (iter == map->end())
+ map->add(containingLayer, Vector<const LocalFrame*>()).storedValue->value.append(child);
Nico 2014/03/26 15:48:15 Should add() ASSERT that the key is non-NULL then?
+ else
+ iter->value.append(child);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698