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

Unified Diff: Source/core/rendering/RenderWidget.cpp

Issue 15741010: Make WidgetHierarchyUpdatesSuspensionScope use swap instead of copy (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 7 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/rendering/RenderWidget.cpp
diff --git a/Source/core/rendering/RenderWidget.cpp b/Source/core/rendering/RenderWidget.cpp
index c4f24f2dfb41baff589d81c81a19f37d0db8240e..3f1a80056d52d87391f3282ad1118e2bcc0e0902 100644
--- a/Source/core/rendering/RenderWidget.cpp
+++ b/Source/core/rendering/RenderWidget.cpp
@@ -53,8 +53,8 @@ WidgetHierarchyUpdatesSuspensionScope::WidgetToParentMap& WidgetHierarchyUpdates
void WidgetHierarchyUpdatesSuspensionScope::moveWidgets()
{
- WidgetToParentMap map = widgetNewParentMap();
- widgetNewParentMap().clear();
+ WidgetToParentMap map;
+ widgetNewParentMap().swap(map);
eseidel 2013/05/23 03:12:22 This extends the lifetime of widgets in this map t
dmichael (off chromium) 2013/05/23 15:52:58 Note how the old code copies the map in line 56. T
WidgetToParentMap::iterator end = map.end();
for (WidgetToParentMap::iterator it = map.begin(); it != end; ++it) {
Widget* child = it->key.get();
« 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