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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 2614663008: Migrate WTF::Vector::append() to ::push_back() [part 13 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) 2014, Google Inc. All rights reserved. 2 * Copyright (C) 2014, Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 m_modificationCount++; 679 m_modificationCount++;
680 postNotification(get(node), notification); 680 postNotification(get(node), notification);
681 } 681 }
682 682
683 void AXObjectCacheImpl::postNotification(AXObject* object, 683 void AXObjectCacheImpl::postNotification(AXObject* object,
684 AXNotification notification) { 684 AXNotification notification) {
685 m_modificationCount++; 685 m_modificationCount++;
686 if (!object) 686 if (!object)
687 return; 687 return;
688 688
689 m_notificationsToPost.append(std::make_pair(object, notification)); 689 m_notificationsToPost.push_back(std::make_pair(object, notification));
690 if (!m_notificationPostTimer.isActive()) 690 if (!m_notificationPostTimer.isActive())
691 m_notificationPostTimer.startOneShot(0, BLINK_FROM_HERE); 691 m_notificationPostTimer.startOneShot(0, BLINK_FROM_HERE);
692 } 692 }
693 693
694 bool AXObjectCacheImpl::isAriaOwned(const AXObject* child) const { 694 bool AXObjectCacheImpl::isAriaOwned(const AXObject* child) const {
695 return m_ariaOwnedChildToOwnerMapping.contains(child->axObjectID()); 695 return m_ariaOwnedChildToOwnerMapping.contains(child->axObjectID());
696 } 696 }
697 697
698 AXObject* AXObjectCacheImpl::getAriaOwnedParent(const AXObject* child) const { 698 AXObject* AXObjectCacheImpl::getAriaOwnedParent(const AXObject* child) const {
699 return objectFromAXID( 699 return objectFromAXID(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 // doesn't appear there, as that would create a cycle. 771 // doesn't appear there, as that would create a cycle.
772 bool foundCycle = false; 772 bool foundCycle = false;
773 for (AXObject* parent = owner->parentObject(); parent && !foundCycle; 773 for (AXObject* parent = owner->parentObject(); parent && !foundCycle;
774 parent = parent->parentObject()) { 774 parent = parent->parentObject()) {
775 if (parent == child) 775 if (parent == child)
776 foundCycle = true; 776 foundCycle = true;
777 } 777 }
778 if (foundCycle) 778 if (foundCycle)
779 continue; 779 continue;
780 780
781 newChildAXIDs.append(child->axObjectID()); 781 newChildAXIDs.push_back(child->axObjectID());
782 ownedChildren.append(child); 782 ownedChildren.push_back(child);
783 } 783 }
784 784
785 // Compare this to the current list of owned children, and exit early if there 785 // Compare this to the current list of owned children, and exit early if there
786 // are no changes. 786 // are no changes.
787 Vector<AXID> currentChildAXIDs = 787 Vector<AXID> currentChildAXIDs =
788 m_ariaOwnerToChildrenMapping.get(owner->axObjectID()); 788 m_ariaOwnerToChildrenMapping.get(owner->axObjectID());
789 bool same = true; 789 bool same = true;
790 if (currentChildAXIDs.size() != newChildAXIDs.size()) { 790 if (currentChildAXIDs.size() != newChildAXIDs.size()) {
791 same = false; 791 same = false;
792 } else { 792 } else {
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 visitor->trace(m_document); 1253 visitor->trace(m_document);
1254 visitor->trace(m_nodeObjectMapping); 1254 visitor->trace(m_nodeObjectMapping);
1255 1255
1256 visitor->trace(m_objects); 1256 visitor->trace(m_objects);
1257 visitor->trace(m_notificationsToPost); 1257 visitor->trace(m_notificationsToPost);
1258 1258
1259 AXObjectCache::trace(visitor); 1259 AXObjectCache::trace(visitor);
1260 } 1260 }
1261 1261
1262 } // namespace blink 1262 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698