| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014, Google Inc. All rights reserved. | 2 * Copyright (C) 2014, Google 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 using namespace HTMLNames; | 86 using namespace HTMLNames; |
| 87 | 87 |
| 88 // static | 88 // static |
| 89 AXObjectCache* AXObjectCacheImpl::create(Document& document) { | 89 AXObjectCache* AXObjectCacheImpl::create(Document& document) { |
| 90 return new AXObjectCacheImpl(document); | 90 return new AXObjectCacheImpl(document); |
| 91 } | 91 } |
| 92 | 92 |
| 93 AXObjectCacheImpl::AXObjectCacheImpl(Document& document) | 93 AXObjectCacheImpl::AXObjectCacheImpl(Document& document) |
| 94 : m_document(document), | 94 : m_document(document), |
| 95 m_modificationCount(0), | 95 m_modificationCount(0), |
| 96 #if ENABLE(ASSERT) | |
| 97 m_hasBeenDisposed(false), | |
| 98 #endif | |
| 99 m_notificationPostTimer(this, | 96 m_notificationPostTimer(this, |
| 100 &AXObjectCacheImpl::notificationPostTimerFired) { | 97 &AXObjectCacheImpl::notificationPostTimerFired) { |
| 101 } | 98 } |
| 102 | 99 |
| 103 AXObjectCacheImpl::~AXObjectCacheImpl() { | 100 AXObjectCacheImpl::~AXObjectCacheImpl() { |
| 104 ASSERT(m_hasBeenDisposed); | 101 ASSERT(m_hasBeenDisposed); |
| 105 } | 102 } |
| 106 | 103 |
| 107 void AXObjectCacheImpl::dispose() { | 104 void AXObjectCacheImpl::dispose() { |
| 108 m_notificationPostTimer.stop(); | 105 m_notificationPostTimer.stop(); |
| 109 | 106 |
| 110 for (auto& entry : m_objects) { | 107 for (auto& entry : m_objects) { |
| 111 AXObject* obj = entry.value; | 108 AXObject* obj = entry.value; |
| 112 obj->detach(); | 109 obj->detach(); |
| 113 removeAXID(obj); | 110 removeAXID(obj); |
| 114 } | 111 } |
| 115 | 112 |
| 116 #if ENABLE(ASSERT) | 113 #if DCHECK_IS_ON() |
| 117 m_hasBeenDisposed = true; | 114 m_hasBeenDisposed = true; |
| 118 #endif | 115 #endif |
| 119 } | 116 } |
| 120 | 117 |
| 121 AXObject* AXObjectCacheImpl::root() { | 118 AXObject* AXObjectCacheImpl::root() { |
| 122 return getOrCreate(m_document); | 119 return getOrCreate(m_document); |
| 123 } | 120 } |
| 124 | 121 |
| 125 AXObject* AXObjectCacheImpl::focusedImageMapUIElement( | 122 AXObject* AXObjectCacheImpl::focusedImageMapUIElement( |
| 126 HTMLAreaElement* areaElement) { | 123 HTMLAreaElement* areaElement) { |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 unsigned i = 0, count = m_notificationsToPost.size(); | 630 unsigned i = 0, count = m_notificationsToPost.size(); |
| 634 for (i = 0; i < count; ++i) { | 631 for (i = 0; i < count; ++i) { |
| 635 AXObject* obj = m_notificationsToPost[i].first; | 632 AXObject* obj = m_notificationsToPost[i].first; |
| 636 | 633 |
| 637 if (!obj->axObjectID()) | 634 if (!obj->axObjectID()) |
| 638 continue; | 635 continue; |
| 639 | 636 |
| 640 if (obj->isDetached()) | 637 if (obj->isDetached()) |
| 641 continue; | 638 continue; |
| 642 | 639 |
| 643 #if ENABLE(ASSERT) | 640 #if DCHECK_IS_ON() |
| 644 // Make sure none of the layout views are in the process of being layed out. | 641 // Make sure none of the layout views are in the process of being layed out. |
| 645 // Notifications should only be sent after the layoutObject has finished | 642 // Notifications should only be sent after the layoutObject has finished |
| 646 if (obj->isAXLayoutObject()) { | 643 if (obj->isAXLayoutObject()) { |
| 647 AXLayoutObject* layoutObj = toAXLayoutObject(obj); | 644 AXLayoutObject* layoutObj = toAXLayoutObject(obj); |
| 648 LayoutObject* layoutObject = layoutObj->getLayoutObject(); | 645 LayoutObject* layoutObject = layoutObj->getLayoutObject(); |
| 649 if (layoutObject && layoutObject->view()) | 646 if (layoutObject && layoutObject->view()) |
| 650 ASSERT(!layoutObject->view()->layoutState()); | 647 ASSERT(!layoutObject->view()->layoutState()); |
| 651 } | 648 } |
| 652 #endif | 649 #endif |
| 653 | 650 |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1253 visitor->trace(m_document); | 1250 visitor->trace(m_document); |
| 1254 visitor->trace(m_nodeObjectMapping); | 1251 visitor->trace(m_nodeObjectMapping); |
| 1255 | 1252 |
| 1256 visitor->trace(m_objects); | 1253 visitor->trace(m_objects); |
| 1257 visitor->trace(m_notificationsToPost); | 1254 visitor->trace(m_notificationsToPost); |
| 1258 | 1255 |
| 1259 AXObjectCache::trace(visitor); | 1256 AXObjectCache::trace(visitor); |
| 1260 } | 1257 } |
| 1261 | 1258 |
| 1262 } // namespace blink | 1259 } // namespace blink |
| OLD | NEW |