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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 11 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 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 1431
1432 // Currently only embedded SVG documents participate in the size-negotiation 1432 // Currently only embedded SVG documents participate in the size-negotiation
1433 // logic. 1433 // logic.
1434 if (firstChild->isSVGRoot()) 1434 if (firstChild->isSVGRoot())
1435 return toLayoutSVGRoot(firstChild); 1435 return toLayoutSVGRoot(firstChild);
1436 1436
1437 return nullptr; 1437 return nullptr;
1438 } 1438 }
1439 1439
1440 void FrameView::addPart(LayoutPart* object) { 1440 void FrameView::addPart(LayoutPart* object) {
1441 m_parts.add(object); 1441 m_parts.insert(object);
1442 } 1442 }
1443 1443
1444 void FrameView::removePart(LayoutPart* object) { 1444 void FrameView::removePart(LayoutPart* object) {
1445 m_parts.remove(object); 1445 m_parts.remove(object);
1446 } 1446 }
1447 1447
1448 void FrameView::updateWidgetGeometries() { 1448 void FrameView::updateWidgetGeometries() {
1449 Vector<RefPtr<LayoutPart>> parts; 1449 Vector<RefPtr<LayoutPart>> parts;
1450 copyToVector(m_parts, parts); 1450 copyToVector(m_parts, parts);
1451 1451
(...skipping 18 matching lines...) Expand all
1470 } 1470 }
1471 1471
1472 void FrameView::addPartToUpdate(LayoutEmbeddedObject& object) { 1472 void FrameView::addPartToUpdate(LayoutEmbeddedObject& object) {
1473 ASSERT(isInPerformLayout()); 1473 ASSERT(isInPerformLayout());
1474 // Tell the DOM element that it needs a widget update. 1474 // Tell the DOM element that it needs a widget update.
1475 Node* node = object.node(); 1475 Node* node = object.node();
1476 ASSERT(node); 1476 ASSERT(node);
1477 if (isHTMLObjectElement(*node) || isHTMLEmbedElement(*node)) 1477 if (isHTMLObjectElement(*node) || isHTMLEmbedElement(*node))
1478 toHTMLPlugInElement(node)->setNeedsWidgetUpdate(true); 1478 toHTMLPlugInElement(node)->setNeedsWidgetUpdate(true);
1479 1479
1480 m_partUpdateSet.add(&object); 1480 m_partUpdateSet.insert(&object);
1481 } 1481 }
1482 1482
1483 void FrameView::setDisplayMode(WebDisplayMode mode) { 1483 void FrameView::setDisplayMode(WebDisplayMode mode) {
1484 if (mode == m_displayMode) 1484 if (mode == m_displayMode)
1485 return; 1485 return;
1486 1486
1487 m_displayMode = mode; 1487 m_displayMode = mode;
1488 1488
1489 if (m_frame->document()) 1489 if (m_frame->document())
1490 m_frame->document()->mediaQueryAffectingValueChanged(); 1490 m_frame->document()->mediaQueryAffectingValueChanged();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 1532
1533 bool FrameView::contentsInCompositedLayer() const { 1533 bool FrameView::contentsInCompositedLayer() const {
1534 LayoutViewItem layoutViewItem = this->layoutViewItem(); 1534 LayoutViewItem layoutViewItem = this->layoutViewItem();
1535 return !layoutViewItem.isNull() && 1535 return !layoutViewItem.isNull() &&
1536 layoutViewItem.compositingState() == PaintsIntoOwnBacking; 1536 layoutViewItem.compositingState() == PaintsIntoOwnBacking;
1537 } 1537 }
1538 1538
1539 void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) { 1539 void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) {
1540 ASSERT(!m_backgroundAttachmentFixedObjects.contains(object)); 1540 ASSERT(!m_backgroundAttachmentFixedObjects.contains(object));
1541 1541
1542 m_backgroundAttachmentFixedObjects.add(object); 1542 m_backgroundAttachmentFixedObjects.insert(object);
1543 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 1543 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
1544 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange( 1544 scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange(
1545 this); 1545 this);
1546 1546
1547 // Ensure main thread scrolling reasons are recomputed. 1547 // Ensure main thread scrolling reasons are recomputed.
1548 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 1548 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
1549 setNeedsPaintPropertyUpdate(); 1549 setNeedsPaintPropertyUpdate();
1550 // The object's scroll properties are not affected by its own background. 1550 // The object's scroll properties are not affected by its own background.
1551 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling(); 1551 object->setAncestorsNeedPaintPropertyUpdateForMainThreadScrolling();
1552 } 1552 }
(...skipping 15 matching lines...) Expand all
1568 } 1568 }
1569 } 1569 }
1570 1570
1571 void FrameView::addViewportConstrainedObject(LayoutObject* object) { 1571 void FrameView::addViewportConstrainedObject(LayoutObject* object) {
1572 if (!m_viewportConstrainedObjects) { 1572 if (!m_viewportConstrainedObjects) {
1573 m_viewportConstrainedObjects = 1573 m_viewportConstrainedObjects =
1574 WTF::wrapUnique(new ViewportConstrainedObjectSet); 1574 WTF::wrapUnique(new ViewportConstrainedObjectSet);
1575 } 1575 }
1576 1576
1577 if (!m_viewportConstrainedObjects->contains(object)) { 1577 if (!m_viewportConstrainedObjects->contains(object)) {
1578 m_viewportConstrainedObjects->add(object); 1578 m_viewportConstrainedObjects->insert(object);
1579 1579
1580 if (ScrollingCoordinator* scrollingCoordinator = 1580 if (ScrollingCoordinator* scrollingCoordinator =
1581 this->scrollingCoordinator()) 1581 this->scrollingCoordinator())
1582 scrollingCoordinator->frameViewFixedObjectsDidChange(this); 1582 scrollingCoordinator->frameViewFixedObjectsDidChange(this);
1583 } 1583 }
1584 } 1584 }
1585 1585
1586 void FrameView::removeViewportConstrainedObject(LayoutObject* object) { 1586 void FrameView::removeViewportConstrainedObject(LayoutObject* object) {
1587 if (m_viewportConstrainedObjects && 1587 if (m_viewportConstrainedObjects &&
1588 m_viewportConstrainedObjects->contains(object)) { 1588 m_viewportConstrainedObjects->contains(object)) {
(...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after
3592 result->pushObject(std::move(itemJSON)); 3592 result->pushObject(std::move(itemJSON));
3593 } 3593 }
3594 } 3594 }
3595 } 3595 }
3596 return result; 3596 return result;
3597 } 3597 }
3598 3598
3599 void FrameView::addResizerArea(LayoutBox& resizerBox) { 3599 void FrameView::addResizerArea(LayoutBox& resizerBox) {
3600 if (!m_resizerAreas) 3600 if (!m_resizerAreas)
3601 m_resizerAreas = WTF::wrapUnique(new ResizerAreaSet); 3601 m_resizerAreas = WTF::wrapUnique(new ResizerAreaSet);
3602 m_resizerAreas->add(&resizerBox); 3602 m_resizerAreas->insert(&resizerBox);
3603 } 3603 }
3604 3604
3605 void FrameView::removeResizerArea(LayoutBox& resizerBox) { 3605 void FrameView::removeResizerArea(LayoutBox& resizerBox) {
3606 if (!m_resizerAreas) 3606 if (!m_resizerAreas)
3607 return; 3607 return;
3608 3608
3609 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox); 3609 ResizerAreaSet::iterator it = m_resizerAreas->find(&resizerBox);
3610 if (it != m_resizerAreas->end()) 3610 if (it != m_resizerAreas->end())
3611 m_resizerAreas->remove(it); 3611 m_resizerAreas->remove(it);
3612 } 3612 }
3613 3613
3614 void FrameView::addScrollableArea(ScrollableArea* scrollableArea) { 3614 void FrameView::addScrollableArea(ScrollableArea* scrollableArea) {
3615 ASSERT(scrollableArea); 3615 ASSERT(scrollableArea);
3616 if (!m_scrollableAreas) 3616 if (!m_scrollableAreas)
3617 m_scrollableAreas = new ScrollableAreaSet; 3617 m_scrollableAreas = new ScrollableAreaSet;
3618 m_scrollableAreas->add(scrollableArea); 3618 m_scrollableAreas->insert(scrollableArea);
3619 3619
3620 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3620 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
3621 scrollingCoordinator->scrollableAreasDidChange(); 3621 scrollingCoordinator->scrollableAreasDidChange();
3622 } 3622 }
3623 3623
3624 void FrameView::removeScrollableArea(ScrollableArea* scrollableArea) { 3624 void FrameView::removeScrollableArea(ScrollableArea* scrollableArea) {
3625 if (!m_scrollableAreas) 3625 if (!m_scrollableAreas)
3626 return; 3626 return;
3627 m_scrollableAreas->remove(scrollableArea); 3627 m_scrollableAreas->remove(scrollableArea);
3628 3628
3629 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) 3629 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
3630 scrollingCoordinator->scrollableAreasDidChange(); 3630 scrollingCoordinator->scrollableAreasDidChange();
3631 } 3631 }
3632 3632
3633 void FrameView::addAnimatingScrollableArea(ScrollableArea* scrollableArea) { 3633 void FrameView::addAnimatingScrollableArea(ScrollableArea* scrollableArea) {
3634 ASSERT(scrollableArea); 3634 ASSERT(scrollableArea);
3635 if (!m_animatingScrollableAreas) 3635 if (!m_animatingScrollableAreas)
3636 m_animatingScrollableAreas = new ScrollableAreaSet; 3636 m_animatingScrollableAreas = new ScrollableAreaSet;
3637 m_animatingScrollableAreas->add(scrollableArea); 3637 m_animatingScrollableAreas->insert(scrollableArea);
3638 } 3638 }
3639 3639
3640 void FrameView::removeAnimatingScrollableArea(ScrollableArea* scrollableArea) { 3640 void FrameView::removeAnimatingScrollableArea(ScrollableArea* scrollableArea) {
3641 if (!m_animatingScrollableAreas) 3641 if (!m_animatingScrollableAreas)
3642 return; 3642 return;
3643 m_animatingScrollableAreas->remove(scrollableArea); 3643 m_animatingScrollableAreas->remove(scrollableArea);
3644 } 3644 }
3645 3645
3646 void FrameView::setParent(Widget* parentView) { 3646 void FrameView::setParent(Widget* parentView) {
3647 if (parentView == parent()) 3647 if (parentView == parent())
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
3752 visibleSize = controller.rootScrollerVisibleArea(); 3752 visibleSize = controller.rootScrollerVisibleArea();
3753 3753
3754 IntSize maximumOffset = 3754 IntSize maximumOffset =
3755 toIntSize(-scrollOrigin() + (contentBounds - visibleSize)); 3755 toIntSize(-scrollOrigin() + (contentBounds - visibleSize));
3756 return maximumOffset.expandedTo(minimumScrollOffsetInt()); 3756 return maximumOffset.expandedTo(minimumScrollOffsetInt());
3757 } 3757 }
3758 3758
3759 void FrameView::addChild(Widget* child) { 3759 void FrameView::addChild(Widget* child) {
3760 ASSERT(child != this && !child->parent()); 3760 ASSERT(child != this && !child->parent());
3761 child->setParent(this); 3761 child->setParent(this);
3762 m_children.add(child); 3762 m_children.insert(child);
3763 } 3763 }
3764 3764
3765 void FrameView::setScrollbarModes(ScrollbarMode horizontalMode, 3765 void FrameView::setScrollbarModes(ScrollbarMode horizontalMode,
3766 ScrollbarMode verticalMode, 3766 ScrollbarMode verticalMode,
3767 bool horizontalLock, 3767 bool horizontalLock,
3768 bool verticalLock) { 3768 bool verticalLock) {
3769 bool needsUpdate = false; 3769 bool needsUpdate = false;
3770 3770
3771 // If the page's overflow setting has disabled scrolling, do not allow 3771 // If the page's overflow setting has disabled scrolling, do not allow
3772 // anything to override that setting, http://crbug.com/426447 3772 // anything to override that setting, http://crbug.com/426447
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
5061 std::unique_ptr<CompositorAnimationTimeline> timeline) { 5061 std::unique_ptr<CompositorAnimationTimeline> timeline) {
5062 m_animationTimeline = std::move(timeline); 5062 m_animationTimeline = std::move(timeline);
5063 } 5063 }
5064 5064
5065 void FrameView::setAnimationHost( 5065 void FrameView::setAnimationHost(
5066 std::unique_ptr<CompositorAnimationHost> host) { 5066 std::unique_ptr<CompositorAnimationHost> host) {
5067 m_animationHost = std::move(host); 5067 m_animationHost = std::move(host);
5068 } 5068 }
5069 5069
5070 } // namespace blink 5070 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameSerializer.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