Line data Source code
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 : #include "xpcAccessibleDocument.h"
10 :
11 : ////////////////////////////////////////////////////////////////////////////////
12 : // Accessible cache utils
13 : ////////////////////////////////////////////////////////////////////////////////
14 :
15 : template <class T>
16 : void
17 0 : UnbindCacheEntriesFromDocument(
18 : nsRefPtrHashtable<nsPtrHashKey<const void>, T>& aCache)
19 : {
20 0 : for (auto iter = aCache.Iter(); !iter.Done(); iter.Next()) {
21 0 : T* accessible = iter.Data();
22 0 : MOZ_ASSERT(accessible && !accessible->IsDefunct());
23 0 : accessible->Document()->UnbindFromDocument(accessible);
24 0 : iter.Remove();
25 : }
26 0 : }
27 :
28 : #endif
|