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

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

Issue 1181613002: Added check for leaking AXObjects 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 }; 362 };
363 363
364 364
365 HTMLDialogElement* getActiveDialogElement(Node* node) 365 HTMLDialogElement* getActiveDialogElement(Node* node)
366 { 366 {
367 return node->document().activeModalDialog(); 367 return node->document().activeModalDialog();
368 } 368 }
369 369
370 } // namespace 370 } // namespace
371 371
372 unsigned AXObject::s_instanceCount = 0;
373
372 AXObject::AXObject(AXObjectCacheImpl* axObjectCache) 374 AXObject::AXObject(AXObjectCacheImpl* axObjectCache)
373 : m_id(0) 375 : m_id(0)
374 , m_haveChildren(false) 376 , m_haveChildren(false)
375 , m_role(UnknownRole) 377 , m_role(UnknownRole)
376 , m_lastKnownIsIgnoredValue(DefaultBehavior) 378 , m_lastKnownIsIgnoredValue(DefaultBehavior)
377 , m_detached(false) 379 , m_detached(false)
378 , m_parent(0) 380 , m_parent(0)
379 , m_lastModificationCount(-1) 381 , m_lastModificationCount(-1)
380 , m_cachedIsIgnored(false) 382 , m_cachedIsIgnored(false)
381 , m_cachedIsInertOrAriaHidden(false) 383 , m_cachedIsInertOrAriaHidden(false)
382 , m_cachedIsDescendantOfLeafNode(false) 384 , m_cachedIsDescendantOfLeafNode(false)
383 , m_cachedIsDescendantOfDisabledNode(false) 385 , m_cachedIsDescendantOfDisabledNode(false)
384 , m_cachedHasInheritedPresentationalRole(false) 386 , m_cachedHasInheritedPresentationalRole(false)
385 , m_cachedIsPresentationalChild(false) 387 , m_cachedIsPresentationalChild(false)
386 , m_cachedLiveRegionRoot(0) 388 , m_cachedLiveRegionRoot(0)
387 , m_axObjectCache(axObjectCache) 389 , m_axObjectCache(axObjectCache)
388 { 390 {
391 ++s_instanceCount;
389 } 392 }
390 393
391 AXObject::~AXObject() 394 AXObject::~AXObject()
392 { 395 {
393 ASSERT(isDetached()); 396 ASSERT(isDetached());
397 --s_instanceCount;
394 } 398 }
395 399
396 void AXObject::detach() 400 void AXObject::detach()
397 { 401 {
398 // Clear any children and call detachFromParent on them so that 402 // Clear any children and call detachFromParent on them so that
399 // no children are left with dangling pointers to their parent. 403 // no children are left with dangling pointers to their parent.
400 clearChildren(); 404 clearChildren();
401 405
402 m_detached = true; 406 m_detached = true;
403 } 407 }
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 } 1475 }
1472 1476
1473 const AtomicString& AXObject::internalRoleName(AccessibilityRole role) 1477 const AtomicString& AXObject::internalRoleName(AccessibilityRole role)
1474 { 1478 {
1475 static const Vector<AtomicString>* internalRoleNameVector = createInternalRo leNameVector(); 1479 static const Vector<AtomicString>* internalRoleNameVector = createInternalRo leNameVector();
1476 1480
1477 return internalRoleNameVector->at(role); 1481 return internalRoleNameVector->at(role);
1478 } 1482 }
1479 1483
1480 } // namespace blink 1484 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXObject.h ('k') | Source/modules/accessibility/AXObjectCacheImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698