| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010 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 * | 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 void AXObjectCache::remove(AbstractInlineTextBox* inlineTextBox) | 564 void AXObjectCache::remove(AbstractInlineTextBox* inlineTextBox) |
| 565 { | 565 { |
| 566 if (!inlineTextBox) | 566 if (!inlineTextBox) |
| 567 return; | 567 return; |
| 568 | 568 |
| 569 AXID axID = m_inlineTextBoxObjectMapping.get(inlineTextBox); | 569 AXID axID = m_inlineTextBoxObjectMapping.get(inlineTextBox); |
| 570 remove(axID); | 570 remove(axID); |
| 571 m_inlineTextBoxObjectMapping.remove(inlineTextBox); | 571 m_inlineTextBoxObjectMapping.remove(inlineTextBox); |
| 572 } | 572 } |
| 573 | 573 |
| 574 // FIXME: Oilpan: Use a weak hashmap for this instead. |
| 575 void AXObjectCache::clearWeakMembers(Visitor* visitor) |
| 576 { |
| 577 Vector<Node*> deadNodes; |
| 578 for (HashMap<Node*, AXID>::iterator it = m_nodeObjectMapping.begin(); it !=
m_nodeObjectMapping.end(); ++it) { |
| 579 if (!visitor->isAlive(it->key)) |
| 580 deadNodes.append(it->key); |
| 581 } |
| 582 for (unsigned i = 0; i < deadNodes.size(); ++i) |
| 583 remove(deadNodes[i]); |
| 584 } |
| 585 |
| 574 AXID AXObjectCache::platformGenerateAXID() const | 586 AXID AXObjectCache::platformGenerateAXID() const |
| 575 { | 587 { |
| 576 static AXID lastUsedID = 0; | 588 static AXID lastUsedID = 0; |
| 577 | 589 |
| 578 // Generate a new ID. | 590 // Generate a new ID. |
| 579 AXID objID = lastUsedID; | 591 AXID objID = lastUsedID; |
| 580 do { | 592 do { |
| 581 ++objID; | 593 ++objID; |
| 582 } while (!objID || HashTraits<AXID>::isDeletedValue(objID) || m_idsInUse.con
tains(objID)); | 594 } while (!objID || HashTraits<AXID>::isDeletedValue(objID) || m_idsInUse.con
tains(objID)); |
| 583 | 595 |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 { | 1012 { |
| 1001 postPlatformNotification(getOrCreate(scrollView), AXScrollPositionChanged); | 1013 postPlatformNotification(getOrCreate(scrollView), AXScrollPositionChanged); |
| 1002 } | 1014 } |
| 1003 | 1015 |
| 1004 void AXObjectCache::handleScrollPositionChanged(RenderObject* renderObject) | 1016 void AXObjectCache::handleScrollPositionChanged(RenderObject* renderObject) |
| 1005 { | 1017 { |
| 1006 postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged)
; | 1018 postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged)
; |
| 1007 } | 1019 } |
| 1008 | 1020 |
| 1009 } // namespace WebCore | 1021 } // namespace WebCore |
| OLD | NEW |