2014-06-30 19:39:45 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-01-05 01:31:26 +03:00
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2007-10-29 16:45:07 +03:00
|
|
|
|
2013-09-12 05:57:53 +04:00
|
|
|
NS_IMETHODIMP_(void)
|
2014-06-27 05:35:39 +04:00
|
|
|
nsXPCOMCycleCollectionParticipant::Root(void* aPtr) {
|
|
|
|
nsISupports* s = static_cast<nsISupports*>(aPtr);
|
|
|
|
NS_ADDREF(s);
|
2007-01-05 01:31:26 +03:00
|
|
|
}
|
|
|
|
|
2013-09-12 05:57:53 +04:00
|
|
|
NS_IMETHODIMP_(void)
|
2014-06-27 05:35:39 +04:00
|
|
|
nsXPCOMCycleCollectionParticipant::Unroot(void* aPtr) {
|
|
|
|
nsISupports* s = static_cast<nsISupports*>(aPtr);
|
|
|
|
NS_RELEASE(s);
|
2007-03-08 14:31:14 +03:00
|
|
|
}
|
|
|
|
|
2012-08-24 20:50:06 +04:00
|
|
|
// We define a default trace function because some participants don't need
|
|
|
|
// to trace anything, so it is okay for them not to define one.
|
2007-10-29 16:45:07 +03:00
|
|
|
NS_IMETHODIMP_(void)
|
2014-06-27 05:35:39 +04:00
|
|
|
nsXPCOMCycleCollectionParticipant::Trace(void* aPtr, const TraceCallbacks& aCb,
|
|
|
|
void* aClosure) {}
|
2007-10-29 16:45:07 +03:00
|
|
|
|
2014-06-27 05:35:39 +04:00
|
|
|
bool nsXPCOMCycleCollectionParticipant::CheckForRightISupports(
|
|
|
|
nsISupports* aSupports) {
|
|
|
|
nsISupports* foo;
|
|
|
|
aSupports->QueryInterface(NS_GET_IID(nsCycleCollectionISupports),
|
|
|
|
reinterpret_cast<void**>(&foo));
|
|
|
|
return aSupports == foo;
|
2007-02-18 17:38:04 +03:00
|
|
|
}
|