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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2696183002: Migrate WTF::HashSet::remove() to ::erase() [part 1] (Closed)
Patch Set: one more platform-specific reference Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 return toLayoutSVGRoot(firstChild); 1441 return toLayoutSVGRoot(firstChild);
1442 1442
1443 return nullptr; 1443 return nullptr;
1444 } 1444 }
1445 1445
1446 void FrameView::addPart(LayoutPart* object) { 1446 void FrameView::addPart(LayoutPart* object) {
1447 m_parts.insert(object); 1447 m_parts.insert(object);
1448 } 1448 }
1449 1449
1450 void FrameView::removePart(LayoutPart* object) { 1450 void FrameView::removePart(LayoutPart* object) {
1451 m_parts.remove(object); 1451 m_parts.erase(object);
1452 } 1452 }
1453 1453
1454 void FrameView::updateWidgetGeometries() { 1454 void FrameView::updateWidgetGeometries() {
1455 Vector<RefPtr<LayoutPart>> parts; 1455 Vector<RefPtr<LayoutPart>> parts;
1456 copyToVector(m_parts, parts); 1456 copyToVector(m_parts, parts);
1457 1457
1458 for (auto part : parts) { 1458 for (auto part : parts) {
1459 // Script or plugins could detach the frame so abort processing if that 1459 // Script or plugins could detach the frame so abort processing if that
1460 // happens. 1460 // happens.
1461 if (layoutViewItem().isNull()) 1461 if (layoutViewItem().isNull())
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 1554 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
1555 setNeedsPaintPropertyUpdate(); 1555 setNeedsPaintPropertyUpdate();
1556 // The object's scroll properties are not affected by its own background. 1556 // The object's scroll properties are not affected by its own background.
1557 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); 1557 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling();
1558 } 1558 }
1559 } 1559 }
1560 1560
1561 void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) { 1561 void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) {
1562 ASSERT(m_backgroundAttachmentFixedObjects.contains(object)); 1562 ASSERT(m_backgroundAttachmentFixedObjects.contains(object));
1563 1563
1564 m_backgroundAttachmentFixedObjects.remove(object); 1564 m_backgroundAttachmentFixedObjects.erase(object);
1565 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 1565 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
1566 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( 1566 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange(
1567 this); 1567 this);
1568 1568
1569 // Ensure main thread scrolling reasons are recomputed. 1569 // Ensure main thread scrolling reasons are recomputed.
1570 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 1570 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
1571 setNeedsPaintPropertyUpdate(); 1571 setNeedsPaintPropertyUpdate();
1572 // The object's scroll properties are not affected by its own background. 1572 // The object's scroll properties are not affected by its own background.
1573 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); 1573 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling();
1574 } 1574 }
(...skipping 10 matching lines...) Expand all
1585 1585
1586 if (ScrollingCoordinator* scrollingCoordinator = 1586 if (ScrollingCoordinator* scrollingCoordinator =
1587 this->scrollingCoordinator()) 1587 this->scrollingCoordinator())
1588 scrollingCoordinator->frameViewFixedObjectsDidChange(this); 1588 scrollingCoordinator->frameViewFixedObjectsDidChange(this);
1589 } 1589 }
1590 } 1590 }
1591 1591
1592 void FrameView::removeViewportConstrainedObject(LayoutObject* object) { 1592 void FrameView::removeViewportConstrainedObject(LayoutObject* object) {
1593 if (m_viewportConstrainedObjects && 1593 if (m_viewportConstrainedObjects &&
1594 m_viewportConstrainedObjects->contains(object)) { 1594 m_viewportConstrainedObjects->contains(object)) {
1595 m_viewportConstrainedObjects->remove(object); 1595 m_viewportConstrainedObjects->erase(object);
1596 1596
1597 if (ScrollingCoordinator* scrollingCoordinator = 1597 if (ScrollingCoordinator* scrollingCoordinator =
1598 this->scrollingCoordinator()) 1598 this->scrollingCoordinator())
1599 scrollingCoordinator->frameViewFixedObjectsDidChange(this); 1599 scrollingCoordinator->frameViewFixedObjectsDidChange(this);
1600 } 1600 }
1601 } 1601 }
1602 1602
1603 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) { 1603 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) {
1604 DCHECK(widthChanged || heightChanged); 1604 DCHECK(widthChanged || heightChanged);
1605 DCHECK(m_frame->host()); 1605 DCHECK(m_frame->host());
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
2415 // No need to update if it's already crashed or known to be missing. 2415 // No need to update if it's already crashed or known to be missing.
2416 if (object.showsUnavailablePluginIndicator()) 2416 if (object.showsUnavailablePluginIndicator())
2417 continue; 2417 continue;
2418 2418
2419 if (element->needsWidgetUpdate()) 2419 if (element->needsWidgetUpdate())
2420 element->updateWidget(); 2420 element->updateWidget();
2421 object.updateWidgetGeometry(); 2421 object.updateWidgetGeometry();
2422 2422
2423 // Prevent plugins from causing infinite updates of themselves. 2423 // Prevent plugins from causing infinite updates of themselves.
2424 // FIXME: Do we really need to prevent this? 2424 // FIXME: Do we really need to prevent this?
2425 m_partUpdateSet.remove(&object); 2425 m_partUpdateSet.erase(&object);
2426 } 2426 }
2427 2427
2428 return m_partUpdateSet.isEmpty(); 2428 return m_partUpdateSet.isEmpty();
2429 } 2429 }
2430 2430
2431 void FrameView::updateWidgetsTimerFired(TimerBase*) { 2431 void FrameView::updateWidgetsTimerFired(TimerBase*) {
2432 ASSERT(!isInPerformLayout()); 2432 ASSERT(!isInPerformLayout());
2433 for (unsigned i = 0; i < maxUpdateWidgetsIterations; ++i) { 2433 for (unsigned i = 0; i < maxUpdateWidgetsIterations; ++i) {
2434 if (updateWidgets()) 2434 if (updateWidgets())
2435 return; 2435 return;
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3699 m_scrollableAreas = new ScrollableAreaSet; 3699 m_scrollableAreas = new ScrollableAreaSet;
3700 m_scrollableAreas->insert(scrollableArea); 3700 m_scrollableAreas->insert(scrollableArea);
3701 3701
3702 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3702 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
3703 scrollingCoordinator->scrollableAreasDidChange(); 3703 scrollingCoordinator->scrollableAreasDidChange();
3704 } 3704 }
3705 3705
3706 void FrameView::removeScrollableArea(ScrollableArea* scrollableArea) { 3706 void FrameView::removeScrollableArea(ScrollableArea* scrollableArea) {
3707 if (!m_scrollableAreas) 3707 if (!m_scrollableAreas)
3708 return; 3708 return;
3709 m_scrollableAreas->remove(scrollableArea); 3709 m_scrollableAreas->erase(scrollableArea);
3710 3710
3711 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3711 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
3712 scrollingCoordinator->scrollableAreasDidChange(); 3712 scrollingCoordinator->scrollableAreasDidChange();
3713 } 3713 }
3714 3714
3715 void FrameView::addAnimatingScrollableArea(ScrollableArea* scrollableArea) { 3715 void FrameView::addAnimatingScrollableArea(ScrollableArea* scrollableArea) {
3716 ASSERT(scrollableArea); 3716 ASSERT(scrollableArea);
3717 if (!m_animatingScrollableAreas) 3717 if (!m_animatingScrollableAreas)
3718 m_animatingScrollableAreas = new ScrollableAreaSet; 3718 m_animatingScrollableAreas = new ScrollableAreaSet;
3719 m_animatingScrollableAreas->insert(scrollableArea); 3719 m_animatingScrollableAreas->insert(scrollableArea);
3720 } 3720 }
3721 3721
3722 void FrameView::removeAnimatingScrollableArea(ScrollableArea* scrollableArea) { 3722 void FrameView::removeAnimatingScrollableArea(ScrollableArea* scrollableArea) {
3723 if (!m_animatingScrollableAreas) 3723 if (!m_animatingScrollableAreas)
3724 return; 3724 return;
3725 m_animatingScrollableAreas->remove(scrollableArea); 3725 m_animatingScrollableAreas->erase(scrollableArea);
3726 } 3726 }
3727 3727
3728 void FrameView::setParent(Widget* parentView) { 3728 void FrameView::setParent(Widget* parentView) {
3729 if (parentView == parent()) 3729 if (parentView == parent())
3730 return; 3730 return;
3731 3731
3732 Widget::setParent(parentView); 3732 Widget::setParent(parentView);
3733 3733
3734 updateParentScrollableAreaSet(); 3734 updateParentScrollableAreaSet();
3735 setupRenderThrottling(); 3735 setupRenderThrottling();
3736 3736
3737 if (parentFrameView()) 3737 if (parentFrameView())
3738 m_subtreeThrottled = parentFrameView()->canThrottleRendering(); 3738 m_subtreeThrottled = parentFrameView()->canThrottleRendering();
3739 } 3739 }
3740 3740
3741 void FrameView::removeChild(Widget* child) { 3741 void FrameView::removeChild(Widget* child) {
3742 ASSERT(child->parent() == this); 3742 ASSERT(child->parent() == this);
3743 3743
3744 if (child->isFrameView() && 3744 if (child->isFrameView() &&
3745 !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) 3745 !RuntimeEnabledFeatures::rootLayerScrollingEnabled())
3746 removeScrollableArea(toFrameView(child)); 3746 removeScrollableArea(toFrameView(child));
3747 3747
3748 child->setParent(0); 3748 child->setParent(0);
3749 m_children.remove(child); 3749 m_children.erase(child);
3750 } 3750 }
3751 3751
3752 bool FrameView::visualViewportSuppliesScrollbars() { 3752 bool FrameView::visualViewportSuppliesScrollbars() {
3753 // On desktop, we always use the layout viewport's scrollbars. 3753 // On desktop, we always use the layout viewport's scrollbars.
3754 if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() || 3754 if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() ||
3755 !m_frame->document() || !m_frame->host()) 3755 !m_frame->document() || !m_frame->host())
3756 return false; 3756 return false;
3757 3757
3758 const TopDocumentRootScrollerController& controller = 3758 const TopDocumentRootScrollerController& controller =
3759 m_frame->host()->globalRootScrollerController(); 3759 m_frame->host()->globalRootScrollerController();
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
5183 void FrameView::setAnimationHost( 5183 void FrameView::setAnimationHost(
5184 std::unique_ptr<CompositorAnimationHost> host) { 5184 std::unique_ptr<CompositorAnimationHost> host) {
5185 m_animationHost = std::move(host); 5185 m_animationHost = std::move(host);
5186 } 5186 }
5187 5187
5188 LayoutUnit FrameView::caretWidth() const { 5188 LayoutUnit FrameView::caretWidth() const {
5189 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5189 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5190 } 5190 }
5191 5191
5192 } // namespace blink 5192 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/EventDispatcher.cpp ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698