Chromium Code Reviews| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 #include "modules/accessibility/AXTableColumn.h" | 78 #include "modules/accessibility/AXTableColumn.h" |
| 79 #include "modules/accessibility/AXTableHeaderContainer.h" | 79 #include "modules/accessibility/AXTableHeaderContainer.h" |
| 80 #include "modules/accessibility/AXTableRow.h" | 80 #include "modules/accessibility/AXTableRow.h" |
| 81 #include "wtf/PassRefPtr.h" | 81 #include "wtf/PassRefPtr.h" |
| 82 | 82 |
| 83 namespace blink { | 83 namespace blink { |
| 84 | 84 |
| 85 using namespace HTMLNames; | 85 using namespace HTMLNames; |
| 86 | 86 |
| 87 // static | 87 // static |
| 88 PassOwnPtr<AXObjectCache> AXObjectCacheImpl::create(Document& document) | 88 PassOwnPtrWillBeRawPtr<AXObjectCache> AXObjectCacheImpl::create(Document& docume nt) |
| 89 { | 89 { |
| 90 return adoptPtr(new AXObjectCacheImpl(document)); | 90 return adoptPtrWillBeNoop(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 , m_notificationPostTimer(this, &AXObjectCacheImpl::notificationPostTimerFir ed) | 96 , m_notificationPostTimer(this, &AXObjectCacheImpl::notificationPostTimerFir ed) |
| 97 { | 97 { |
| 98 } | 98 } |
| 99 | 99 |
| 100 AXObjectCacheImpl::~AXObjectCacheImpl() | 100 AXObjectCacheImpl::~AXObjectCacheImpl() |
|
haraken
2015/04/28 10:45:21
Can we insert an ASSERT to verify that dispose() h
keishi
2015/05/28 06:49:15
Done.
| |
| 101 { | 101 { |
| 102 } | |
| 103 | |
| 104 void AXObjectCacheImpl::dispose() | |
| 105 { | |
| 102 m_notificationPostTimer.stop(); | 106 m_notificationPostTimer.stop(); |
| 103 | 107 |
| 104 HashMap<AXID, RefPtr<AXObject>>::iterator end = m_objects.end(); | 108 HashMap<AXID, RefPtr<AXObject>>::iterator end = m_objects.end(); |
| 105 for (HashMap<AXID, RefPtr<AXObject>>::iterator it = m_objects.begin(); it != end; ++it) { | 109 for (HashMap<AXID, RefPtr<AXObject>>::iterator it = m_objects.begin(); it != end; ++it) { |
| 106 AXObject* obj = (*it).value.get(); | 110 AXObject* obj = (*it).value.get(); |
| 107 obj->detach(); | 111 obj->detach(); |
| 108 removeAXID(obj); | 112 removeAXID(obj); |
| 109 } | 113 } |
| 110 } | 114 } |
| 111 | 115 |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1149 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect) | 1153 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect) |
| 1150 { | 1154 { |
| 1151 AXObject* obj = getOrCreate(element); | 1155 AXObject* obj = getOrCreate(element); |
| 1152 if (!obj) | 1156 if (!obj) |
| 1153 return; | 1157 return; |
| 1154 | 1158 |
| 1155 obj->setElementRect(rect); | 1159 obj->setElementRect(rect); |
| 1156 } | 1160 } |
| 1157 | 1161 |
| 1158 } // namespace blink | 1162 } // namespace blink |
| OLD | NEW |