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

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

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase upto and resolve r182737 conflict. Created 6 years, 2 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) 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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 // FIXME: Oilpan: Use a weak hashmap for this instead. 572 // FIXME: Oilpan: Use a weak hashmap for this instead.
573 void AXObjectCache::clearWeakMembers(Visitor* visitor) 573 void AXObjectCache::clearWeakMembers(Visitor* visitor)
574 { 574 {
575 Vector<Node*> deadNodes; 575 Vector<Node*> deadNodes;
576 for (HashMap<Node*, AXID>::iterator it = m_nodeObjectMapping.begin(); it != m_nodeObjectMapping.end(); ++it) { 576 for (HashMap<Node*, AXID>::iterator it = m_nodeObjectMapping.begin(); it != m_nodeObjectMapping.end(); ++it) {
577 if (!visitor->isAlive(it->key)) 577 if (!visitor->isAlive(it->key))
578 deadNodes.append(it->key); 578 deadNodes.append(it->key);
579 } 579 }
580 for (unsigned i = 0; i < deadNodes.size(); ++i) 580 for (unsigned i = 0; i < deadNodes.size(); ++i)
581 remove(deadNodes[i]); 581 remove(deadNodes[i]);
582
583 Vector<Widget*> deadWidgets;
584 for (HashMap<Widget*, AXID>::iterator it = m_widgetObjectMapping.begin(); it != m_widgetObjectMapping.end(); ++it) {
585 if (!visitor->isAlive(it->key))
586 deadWidgets.append(it->key);
587 }
588 for (unsigned i = 0; i < deadWidgets.size(); ++i)
589 remove(deadWidgets[i]);
582 } 590 }
583 591
584 AXID AXObjectCache::platformGenerateAXID() const 592 AXID AXObjectCache::platformGenerateAXID() const
585 { 593 {
586 static AXID lastUsedID = 0; 594 static AXID lastUsedID = 0;
587 595
588 // Generate a new ID. 596 // Generate a new ID.
589 AXID objID = lastUsedID; 597 AXID objID = lastUsedID;
590 do { 598 do {
591 ++objID; 599 ++objID;
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 void AXObjectCache::setCanvasObjectBounds(Element* element, const LayoutRect& re ct) 1048 void AXObjectCache::setCanvasObjectBounds(Element* element, const LayoutRect& re ct)
1041 { 1049 {
1042 AXObject* obj = getOrCreate(element); 1050 AXObject* obj = getOrCreate(element);
1043 if (!obj) 1051 if (!obj)
1044 return; 1052 return;
1045 1053
1046 obj->setElementRect(rect); 1054 obj->setElementRect(rect);
1047 } 1055 }
1048 1056
1049 } // namespace blink 1057 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698