/src/mozilla-central/dom/base/nsCCUncollectableMarker.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef nsCCUncollectableMarker_h_ |
8 | | #define nsCCUncollectableMarker_h_ |
9 | | |
10 | | #include "js/TracingAPI.h" |
11 | | #include "mozilla/Attributes.h" |
12 | | #include "nsIObserver.h" |
13 | | |
14 | | class nsCCUncollectableMarker final : public nsIObserver |
15 | | { |
16 | | NS_DECL_ISUPPORTS |
17 | | NS_DECL_NSIOBSERVER |
18 | | |
19 | | /** |
20 | | * Inits a global nsCCUncollectableMarker. Should only be called once. |
21 | | */ |
22 | | static nsresult Init(); |
23 | | |
24 | | /** |
25 | | * Checks if we're collecting during a given generation |
26 | | */ |
27 | | static bool InGeneration(uint32_t aGeneration) |
28 | 0 | { |
29 | 0 | return aGeneration && aGeneration == sGeneration; |
30 | 0 | } |
31 | | |
32 | | template <class CCCallback> |
33 | | static bool InGeneration(CCCallback& aCb, uint32_t aGeneration) |
34 | 0 | { |
35 | 0 | return InGeneration(aGeneration) && !aCb.WantAllTraces(); |
36 | 0 | } Unexecuted instantiation: bool nsCCUncollectableMarker::InGeneration<nsCycleCollectionNoteRootCallback>(nsCycleCollectionNoteRootCallback&, unsigned int) Unexecuted instantiation: bool nsCCUncollectableMarker::InGeneration<nsCycleCollectionTraversalCallback>(nsCycleCollectionTraversalCallback&, unsigned int) |
37 | | |
38 | | static uint32_t sGeneration; |
39 | | |
40 | | private: |
41 | 3 | nsCCUncollectableMarker() {} |
42 | 0 | ~nsCCUncollectableMarker() {} |
43 | | }; |
44 | | |
45 | | namespace mozilla { |
46 | | namespace dom { |
47 | | void TraceBlackJS(JSTracer* aTrc, bool aIsShutdownGC); |
48 | | } // namespace dom |
49 | | } // namespace mozilla |
50 | | |
51 | | #endif |