nsAccCache.h (890B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #ifndef _nsAccCache_H_ 7 #define _nsAccCache_H_ 8 9 //////////////////////////////////////////////////////////////////////////////// 10 // LocalAccessible cache utils 11 //////////////////////////////////////////////////////////////////////////////// 12 13 template <class T> 14 void UnbindCacheEntriesFromDocument( 15 nsRefPtrHashtable<nsPtrHashKey<const void>, T>& aCache) { 16 for (auto iter = aCache.Iter(); !iter.Done(); iter.Next()) { 17 T* accessible = iter.Data(); 18 MOZ_ASSERT(accessible && !accessible->IsDefunct()); 19 accessible->Document()->UnbindFromDocument(accessible); 20 iter.Remove(); 21 } 22 } 23 24 #endif