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

Side by Side Diff: Source/core/accessibility/AXObjectCache.cpp

Issue 235113002: Oilpan: Remove guardRef and guardDeref from TreeScope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 void AXObjectCache::remove(AbstractInlineTextBox* inlineTextBox) 560 void AXObjectCache::remove(AbstractInlineTextBox* inlineTextBox)
561 { 561 {
562 if (!inlineTextBox) 562 if (!inlineTextBox)
563 return; 563 return;
564 564
565 AXID axID = m_inlineTextBoxObjectMapping.get(inlineTextBox); 565 AXID axID = m_inlineTextBoxObjectMapping.get(inlineTextBox);
566 remove(axID); 566 remove(axID);
567 m_inlineTextBoxObjectMapping.remove(inlineTextBox); 567 m_inlineTextBoxObjectMapping.remove(inlineTextBox);
568 } 568 }
569 569
570 // FIXME: Oilpan: Use a weak hashmap for this instead.
571 void AXObjectCache::clearWeakMembers(Visitor* visitor)
572 {
573 Vector<Node*> deadNodes;
574 for (HashMap<Node*, AXID>::iterator it = m_nodeObjectMapping.begin(); it != m_nodeObjectMapping.end(); ++it) {
575 if (!visitor->isAlive(it->key))
576 deadNodes.append(it->key);
577 }
578 for (unsigned i = 0; i < deadNodes.size(); ++i)
579 remove(deadNodes[i]);
580 }
581
570 AXID AXObjectCache::platformGenerateAXID() const 582 AXID AXObjectCache::platformGenerateAXID() const
571 { 583 {
572 static AXID lastUsedID = 0; 584 static AXID lastUsedID = 0;
573 585
574 // Generate a new ID. 586 // Generate a new ID.
575 AXID objID = lastUsedID; 587 AXID objID = lastUsedID;
576 do { 588 do {
577 ++objID; 589 ++objID;
578 } while (!objID || HashTraits<AXID>::isDeletedValue(objID) || m_idsInUse.con tains(objID)); 590 } while (!objID || HashTraits<AXID>::isDeletedValue(objID) || m_idsInUse.con tains(objID));
579 591
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 { 1075 {
1064 postPlatformNotification(getOrCreate(scrollView), AXScrollPositionChanged); 1076 postPlatformNotification(getOrCreate(scrollView), AXScrollPositionChanged);
1065 } 1077 }
1066 1078
1067 void AXObjectCache::handleScrollPositionChanged(RenderObject* renderObject) 1079 void AXObjectCache::handleScrollPositionChanged(RenderObject* renderObject)
1068 { 1080 {
1069 postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged) ; 1081 postPlatformNotification(getOrCreate(renderObject), AXScrollPositionChanged) ;
1070 } 1082 }
1071 1083
1072 } // namespace WebCore 1084 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698