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

Side by Side Diff: Source/modules/accessibility/AXObject.cpp

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } 368 }
369 369
370 } // namespace 370 } // namespace
371 371
372 AXObject::AXObject(AXObjectCacheImpl* axObjectCache) 372 AXObject::AXObject(AXObjectCacheImpl* axObjectCache)
373 : m_id(0) 373 : m_id(0)
374 , m_haveChildren(false) 374 , m_haveChildren(false)
375 , m_role(UnknownRole) 375 , m_role(UnknownRole)
376 , m_lastKnownIsIgnoredValue(DefaultBehavior) 376 , m_lastKnownIsIgnoredValue(DefaultBehavior)
377 , m_detached(false) 377 , m_detached(false)
378 , m_parent(0) 378 , m_parent(nullptr)
379 , m_lastModificationCount(-1) 379 , m_lastModificationCount(-1)
380 , m_cachedIsIgnored(false) 380 , m_cachedIsIgnored(false)
381 , m_cachedIsInertOrAriaHidden(false) 381 , m_cachedIsInertOrAriaHidden(false)
382 , m_cachedIsDescendantOfLeafNode(false) 382 , m_cachedIsDescendantOfLeafNode(false)
383 , m_cachedIsDescendantOfDisabledNode(false) 383 , m_cachedIsDescendantOfDisabledNode(false)
384 , m_cachedHasInheritedPresentationalRole(false) 384 , m_cachedHasInheritedPresentationalRole(false)
385 , m_cachedIsPresentationalChild(false) 385 , m_cachedIsPresentationalChild(false)
386 , m_cachedLiveRegionRoot(0) 386 , m_cachedLiveRegionRoot(nullptr)
387 , m_axObjectCache(axObjectCache) 387 , m_axObjectCache(axObjectCache)
388 { 388 {
389 } 389 }
390 390
391 AXObject::~AXObject() 391 AXObject::~AXObject()
392 { 392 {
393 ASSERT(isDetached()); 393 ASSERT(isDetached());
394 } 394 }
395 395
396 void AXObject::detach() 396 void AXObject::detach()
397 { 397 {
398 // Clear any children and call detachFromParent on them so that 398 // Clear any children and call detachFromParent on them so that
399 // no children are left with dangling pointers to their parent. 399 // no children are left with dangling pointers to their parent.
400 clearChildren(); 400 clearChildren();
401 401 m_axObjectCache = nullptr;
402 m_detached = true; 402 m_detached = true;
403 } 403 }
404 404
405 bool AXObject::isDetached() const 405 bool AXObject::isDetached() const
406 { 406 {
407 return m_detached; 407 return m_detached;
408 } 408 }
409 409
410 bool AXObject::isARIATextControl() const 410 bool AXObject::isARIATextControl() const
411 { 411 {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 updateCachedAttributeValuesIfNeeded(); 659 updateCachedAttributeValuesIfNeeded();
660 return m_cachedHasInheritedPresentationalRole; 660 return m_cachedHasInheritedPresentationalRole;
661 } 661 }
662 662
663 bool AXObject::isPresentationalChild() const 663 bool AXObject::isPresentationalChild() const
664 { 664 {
665 updateCachedAttributeValuesIfNeeded(); 665 updateCachedAttributeValuesIfNeeded();
666 return m_cachedIsPresentationalChild; 666 return m_cachedIsPresentationalChild;
667 } 667 }
668 668
669 String AXObject::name(AXNameFrom& nameFrom, Vector<AXObject*>& nameObjects) 669 String AXObject::name(AXNameFrom& nameFrom, WillBeHeapVector<RawPtrWillBeMember< AXObject>>& nameObjects)
670 { 670 {
671 HashSet<AXObject*> visited; 671 WillBeHeapHashSet<RawPtrWillBeMember<AXObject>> visited;
672 return textAlternative(false, false, visited, &nameFrom, &nameObjects); 672 return textAlternative(false, false, visited, &nameFrom, &nameObjects);
673 } 673 }
674 674
675 // In ARIA 1.1, the default value for aria-orientation changed from horizontal t o undefined. 675 // In ARIA 1.1, the default value for aria-orientation changed from horizontal t o undefined.
676 AccessibilityOrientation AXObject::orientation() const 676 AccessibilityOrientation AXObject::orientation() const
677 { 677 {
678 return AccessibilityOrientationUndefined; 678 return AccessibilityOrientationUndefined;
679 } 679 }
680 680
681 static String queryString(WebLocalizedString::Name name) 681 static String queryString(WebLocalizedString::Name name)
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 return roleNameVector->at(role); 1470 return roleNameVector->at(role);
1471 } 1471 }
1472 1472
1473 const AtomicString& AXObject::internalRoleName(AccessibilityRole role) 1473 const AtomicString& AXObject::internalRoleName(AccessibilityRole role)
1474 { 1474 {
1475 static const Vector<AtomicString>* internalRoleNameVector = createInternalRo leNameVector(); 1475 static const Vector<AtomicString>* internalRoleNameVector = createInternalRo leNameVector();
1476 1476
1477 return internalRoleNameVector->at(role); 1477 return internalRoleNameVector->at(role);
1478 } 1478 }
1479 1479
1480 DEFINE_TRACE(AXObject)
1481 {
1482 visitor->trace(m_children);
1483 visitor->trace(m_parent);
1484 visitor->trace(m_cachedLiveRegionRoot);
1485 visitor->trace(m_axObjectCache);
dmazzoni 2015/06/08 15:25:49 Why is this circular reference needed? It doesn't
haraken 2015/06/09 02:25:45 We don't need to worry about circular references w
keishi 2015/06/09 05:51:19 Like haraken said we don't need to worry about cir
dmazzoni 2015/06/09 18:07:28 I like the idea of using m_axObjectCache instead o
haraken 2015/06/10 00:55:57 I think the AccessibilityText part can be landed s
1486 }
1487
1480 } // namespace blink 1488 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698