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/. */
7 #include "nsCycleCollectionParticipant.h"
11 nsXPCOMCycleCollectionParticipant::Root(void* aPtr
) {
12 nsISupports
* s
= static_cast<nsISupports
*>(aPtr
);
17 nsXPCOMCycleCollectionParticipant::Unroot(void* aPtr
) {
18 nsISupports
* s
= static_cast<nsISupports
*>(aPtr
);
22 // We define a default trace function because some participants don't need
23 // to trace anything, so it is okay for them not to define one.
25 nsXPCOMCycleCollectionParticipant::Trace(void* aPtr
, const TraceCallbacks
& aCb
,
28 bool nsXPCOMCycleCollectionParticipant::CheckForRightISupports(
29 nsISupports
* aSupports
) {
31 aSupports
->QueryInterface(NS_GET_IID(nsCycleCollectionISupports
),
32 reinterpret_cast<void**>(&foo
));
33 return aSupports
== foo
;