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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2776203002: Migrate WTF::Vector::remove() to ::erase() (Closed)
Patch Set: rebase, repatch VectorTest 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 while (!m_children.isEmpty()) { 229 while (!m_children.isEmpty()) {
230 GraphicsLayer* curLayer = m_children.back(); 230 GraphicsLayer* curLayer = m_children.back();
231 DCHECK(curLayer->parent()); 231 DCHECK(curLayer->parent());
232 curLayer->removeFromParent(); 232 curLayer->removeFromParent();
233 } 233 }
234 } 234 }
235 235
236 void GraphicsLayer::removeFromParent() { 236 void GraphicsLayer::removeFromParent() {
237 if (m_parent) { 237 if (m_parent) {
238 // We use reverseFind so that removeAllChildren() isn't n^2. 238 // We use reverseFind so that removeAllChildren() isn't n^2.
239 m_parent->m_children.remove(m_parent->m_children.reverseFind(this)); 239 m_parent->m_children.erase(m_parent->m_children.reverseFind(this));
240 setParent(0); 240 setParent(0);
241 } 241 }
242 242
243 platformLayer()->removeFromParent(); 243 platformLayer()->removeFromParent();
244 } 244 }
245 245
246 void GraphicsLayer::setOffsetFromLayoutObject( 246 void GraphicsLayer::setOffsetFromLayoutObject(
247 const IntSize& offset, 247 const IntSize& offset,
248 ShouldSetNeedsDisplay shouldSetNeedsDisplay) { 248 ShouldSetNeedsDisplay shouldSetNeedsDisplay) {
249 setOffsetDoubleFromLayoutObject(offset); 249 setOffsetDoubleFromLayoutObject(offset);
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 } 1106 }
1107 1107
1108 void GraphicsLayer::addLinkHighlight(LinkHighlight* linkHighlight) { 1108 void GraphicsLayer::addLinkHighlight(LinkHighlight* linkHighlight) {
1109 DCHECK(linkHighlight && !m_linkHighlights.contains(linkHighlight)); 1109 DCHECK(linkHighlight && !m_linkHighlights.contains(linkHighlight));
1110 m_linkHighlights.push_back(linkHighlight); 1110 m_linkHighlights.push_back(linkHighlight);
1111 linkHighlight->layer()->setLayerClient(this); 1111 linkHighlight->layer()->setLayerClient(this);
1112 updateChildList(); 1112 updateChildList();
1113 } 1113 }
1114 1114
1115 void GraphicsLayer::removeLinkHighlight(LinkHighlight* linkHighlight) { 1115 void GraphicsLayer::removeLinkHighlight(LinkHighlight* linkHighlight) {
1116 m_linkHighlights.remove(m_linkHighlights.find(linkHighlight)); 1116 m_linkHighlights.erase(m_linkHighlights.find(linkHighlight));
1117 updateChildList(); 1117 updateChildList();
1118 } 1118 }
1119 1119
1120 void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, 1120 void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea,
1121 bool isVisualViewport) { 1121 bool isVisualViewport) {
1122 if (m_scrollableArea == scrollableArea) 1122 if (m_scrollableArea == scrollableArea)
1123 return; 1123 return;
1124 1124
1125 m_scrollableArea = scrollableArea; 1125 m_scrollableArea = scrollableArea;
1126 1126
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1290 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1291 if (!layer) { 1291 if (!layer) {
1292 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; 1292 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil).";
1293 return; 1293 return;
1294 } 1294 }
1295 1295
1296 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1296 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1297 LOG(INFO) << output.utf8().data(); 1297 LOG(INFO) << output.utf8().data();
1298 } 1298 }
1299 #endif 1299 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698