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

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 return node->document().activeModalDialog(); 368 return node->document().activeModalDialog();
369 } 369 }
370 370
371 } // namespace 371 } // namespace
372 372
373 AXObject::AXObject(AXObjectCacheImpl& axObjectCache) 373 AXObject::AXObject(AXObjectCacheImpl& axObjectCache)
374 : m_id(0) 374 : m_id(0)
375 , m_haveChildren(false) 375 , m_haveChildren(false)
376 , m_role(UnknownRole) 376 , m_role(UnknownRole)
377 , m_lastKnownIsIgnoredValue(DefaultBehavior) 377 , m_lastKnownIsIgnoredValue(DefaultBehavior)
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
tkent 2015/06/25 00:20:47 unnecessary change
keishi 2015/06/25 03:29:28 Done.
402 m_axObjectCache = nullptr; 401 m_axObjectCache = nullptr;
403 } 402 }
404 403
405 bool AXObject::isDetached() const 404 bool AXObject::isDetached() const
406 { 405 {
407 return !m_axObjectCache; 406 return !m_axObjectCache;
408 } 407 }
409 408
410 bool AXObject::isARIATextControl() const 409 bool AXObject::isARIATextControl() const
411 { 410 {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 updateCachedAttributeValuesIfNeeded(); 659 updateCachedAttributeValuesIfNeeded();
661 return m_cachedHasInheritedPresentationalRole; 660 return m_cachedHasInheritedPresentationalRole;
662 } 661 }
663 662
664 bool AXObject::isPresentationalChild() const 663 bool AXObject::isPresentationalChild() const
665 { 664 {
666 updateCachedAttributeValuesIfNeeded(); 665 updateCachedAttributeValuesIfNeeded();
667 return m_cachedIsPresentationalChild; 666 return m_cachedIsPresentationalChild;
668 } 667 }
669 668
670 String AXObject::name(AXNameFrom& nameFrom, Vector<AXObject*>& nameObjects) 669 String AXObject::name(AXNameFrom& nameFrom, WillBeHeapVector<RawPtrWillBeMember< AXObject>>& nameObjects)
671 { 670 {
672 HashSet<AXObject*> visited; 671 WillBeHeapHashSet<RawPtrWillBeMember<AXObject>> visited;
673 return textAlternative(false, false, visited, &nameFrom, &nameObjects); 672 return textAlternative(false, false, visited, &nameFrom, &nameObjects);
674 } 673 }
675 674
676 // 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.
677 AccessibilityOrientation AXObject::orientation() const 676 AccessibilityOrientation AXObject::orientation() const
678 { 677 {
679 return AccessibilityOrientationUndefined; 678 return AccessibilityOrientationUndefined;
680 } 679 }
681 680
682 static String queryString(WebLocalizedString::Name name) 681 static String queryString(WebLocalizedString::Name name)
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 return roleNameVector->at(role); 1472 return roleNameVector->at(role);
1474 } 1473 }
1475 1474
1476 const AtomicString& AXObject::internalRoleName(AccessibilityRole role) 1475 const AtomicString& AXObject::internalRoleName(AccessibilityRole role)
1477 { 1476 {
1478 static const Vector<AtomicString>* internalRoleNameVector = createInternalRo leNameVector(); 1477 static const Vector<AtomicString>* internalRoleNameVector = createInternalRo leNameVector();
1479 1478
1480 return internalRoleNameVector->at(role); 1479 return internalRoleNameVector->at(role);
1481 } 1480 }
1482 1481
1482 DEFINE_TRACE(AXObject)
1483 {
1484 visitor->trace(m_children);
1485 visitor->trace(m_parent);
1486 visitor->trace(m_cachedLiveRegionRoot);
1487 visitor->trace(m_axObjectCache);
1488 }
1489
1483 } // namespace blink 1490 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698