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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.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) 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 void AXObjectCacheImpl::removeAXID(AXObject* object) { 551 void AXObjectCacheImpl::removeAXID(AXObject* object) {
552 if (!object) 552 if (!object)
553 return; 553 return;
554 554
555 AXID objID = object->axObjectID(); 555 AXID objID = object->axObjectID();
556 if (!objID) 556 if (!objID)
557 return; 557 return;
558 ASSERT(!HashTraits<AXID>::isDeletedValue(objID)); 558 ASSERT(!HashTraits<AXID>::isDeletedValue(objID));
559 ASSERT(m_idsInUse.contains(objID)); 559 ASSERT(m_idsInUse.contains(objID));
560 object->setAXObjectID(0); 560 object->setAXObjectID(0);
561 m_idsInUse.remove(objID); 561 m_idsInUse.erase(objID);
562 562
563 if (m_ariaOwnerToChildrenMapping.contains(objID)) { 563 if (m_ariaOwnerToChildrenMapping.contains(objID)) {
564 Vector<AXID> childAXIDs = m_ariaOwnerToChildrenMapping.get(objID); 564 Vector<AXID> childAXIDs = m_ariaOwnerToChildrenMapping.get(objID);
565 for (size_t i = 0; i < childAXIDs.size(); ++i) 565 for (size_t i = 0; i < childAXIDs.size(); ++i)
566 m_ariaOwnedChildToOwnerMapping.erase(childAXIDs[i]); 566 m_ariaOwnedChildToOwnerMapping.erase(childAXIDs[i]);
567 m_ariaOwnerToChildrenMapping.erase(objID); 567 m_ariaOwnerToChildrenMapping.erase(objID);
568 } 568 }
569 m_ariaOwnedChildToOwnerMapping.erase(objID); 569 m_ariaOwnedChildToOwnerMapping.erase(objID);
570 m_ariaOwnedChildToRealParentMapping.erase(objID); 570 m_ariaOwnedChildToRealParentMapping.erase(objID);
571 m_ariaOwnerToIdsMapping.erase(objID); 571 m_ariaOwnerToIdsMapping.erase(objID);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 m_idToAriaOwnersMapping.set(id, WTF::wrapUnique(owners)); 717 m_idToAriaOwnersMapping.set(id, WTF::wrapUnique(owners));
718 } 718 }
719 owners->insert(owner->axObjectID()); 719 owners->insert(owner->axObjectID());
720 } 720 }
721 } 721 }
722 for (const String& id : currentIds) { 722 for (const String& id : currentIds) {
723 if (!newIds.contains(id)) { 723 if (!newIds.contains(id)) {
724 idsChanged = true; 724 idsChanged = true;
725 HashSet<AXID>* owners = m_idToAriaOwnersMapping.get(id); 725 HashSet<AXID>* owners = m_idToAriaOwnersMapping.get(id);
726 if (owners) { 726 if (owners) {
727 owners->remove(owner->axObjectID()); 727 owners->erase(owner->axObjectID());
728 if (owners->isEmpty()) 728 if (owners->isEmpty())
729 m_idToAriaOwnersMapping.erase(id); 729 m_idToAriaOwnersMapping.erase(id);
730 } 730 }
731 } 731 }
732 } 732 }
733 if (idsChanged) 733 if (idsChanged)
734 m_ariaOwnerToIdsMapping.set(owner->axObjectID(), newIds); 734 m_ariaOwnerToIdsMapping.set(owner->axObjectID(), newIds);
735 735
736 // 736 //
737 // Now figure out the ids that actually correspond to children that exist and 737 // Now figure out the ids that actually correspond to children that exist and
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 visitor->trace(m_document); 1248 visitor->trace(m_document);
1249 visitor->trace(m_nodeObjectMapping); 1249 visitor->trace(m_nodeObjectMapping);
1250 1250
1251 visitor->trace(m_objects); 1251 visitor->trace(m_objects);
1252 visitor->trace(m_notificationsToPost); 1252 visitor->trace(m_notificationsToPost);
1253 1253
1254 AXObjectCache::trace(visitor); 1254 AXObjectCache::trace(visitor);
1255 } 1255 }
1256 1256
1257 } // namespace blink 1257 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698