Bug 1029660 - Remove nsContentUtils::DeferredFinalize. r=peterv

This commit is contained in:
Andrew McCreight 2014-06-26 09:29:05 -07:00
parent 216804a0b7
commit 755e7c59b3
6 changed files with 12 additions and 36 deletions

View File

@ -121,16 +121,6 @@ namespace layers {
class LayerManager;
} // namespace layers
// Called back from DeferredFinalize. Should add 'thing' to the array of smart
// pointers in 'pointers', creating the array if 'pointers' is null, and return
// the array.
typedef void* (*DeferredFinalizeAppendFunction)(void* pointers, void* thing);
// Called to finalize a number of objects. Slice is the number of objects
// to finalize, or if it's UINT32_MAX, all objects should be finalized.
// Return value indicates whether it finalized all objects in the buffer.
typedef bool (*DeferredFinalizeFunction)(uint32_t slice, void* data);
} // namespace mozilla
class nsIBidiKeyboard;
@ -1280,11 +1270,6 @@ public:
static void DestroyAnonymousContent(nsCOMPtr<nsIContent>* aContent);
static void DestroyAnonymousContent(nsCOMPtr<Element>* aElement);
static void DeferredFinalize(nsISupports* aSupports);
static void DeferredFinalize(mozilla::DeferredFinalizeAppendFunction aAppendFunc,
mozilla::DeferredFinalizeFunction aFunc,
void* aThing);
/*
* Notify when the first XUL menu is opened and when the all XUL menus are
* closed. At opening, aInstalling should be TRUE, otherwise, it should be

View File

@ -6065,22 +6065,6 @@ nsContentUtils::AllocClassMatchingInfo(nsINode* aRootNode,
return info;
}
// static
void
nsContentUtils::DeferredFinalize(nsISupports* aSupports)
{
cyclecollector::DeferredFinalize(aSupports);
}
// static
void
nsContentUtils::DeferredFinalize(mozilla::DeferredFinalizeAppendFunction aAppendFunc,
mozilla::DeferredFinalizeFunction aFunc,
void* aThing)
{
cyclecollector::DeferredFinalize(aAppendFunc, aFunc, aThing);
}
// static
bool
nsContentUtils::IsFocusedContent(const nsIContent* aContent)

View File

@ -51,6 +51,7 @@
#include "prprf.h"
#include "nsNodeUtils.h"
#include "nsJSUtils.h"
#include "nsCycleCollector.h"
// Nasty hack. Maybe we could move some of the classinfo utility methods
// (e.g. WrapNative) over to nsContentUtils?
@ -73,7 +74,7 @@ XBLFinalize(JSFreeOp *fop, JSObject *obj)
{
nsXBLDocumentInfo* docInfo =
static_cast<nsXBLDocumentInfo*>(::JS_GetPrivate(obj));
nsContentUtils::DeferredFinalize(docInfo);
cyclecollector::DeferredFinalize(docInfo);
}
static bool

View File

@ -450,7 +450,7 @@ nsXPCWrappedJS::Unlink()
if (mOuter) {
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
if (rt->GCIsRunning()) {
nsContentUtils::DeferredFinalize(mOuter.forget().take());
cyclecollector::DeferredFinalize(mOuter.forget().take());
} else {
mOuter = nullptr;
}

View File

@ -631,7 +631,7 @@ XPCWrappedNative::Destroy()
if (mIdentity) {
XPCJSRuntime* rt = GetRuntime();
if (rt && rt->GetDoingFinalization()) {
nsContentUtils::DeferredFinalize(mIdentity);
cyclecollector::DeferredFinalize(mIdentity);
mIdentity = nullptr;
} else {
NS_RELEASE(mIdentity);
@ -959,7 +959,7 @@ XPCWrappedNative::FlatJSObjectFinalized()
#endif
XPCJSRuntime* rt = GetRuntime();
if (rt) {
nsContentUtils::DeferredFinalize(obj);
cyclecollector::DeferredFinalize(obj);
} else {
obj->Release();
}

View File

@ -18,8 +18,14 @@ namespace mozilla {
class CycleCollectedJSRuntime;
// See the comments in nsContentUtils.h for explanations of these functions.
// Called back from DeferredFinalize. Should add 'thing' to the array of smart
// pointers in 'pointers', creating the array if 'pointers' is null, and return
// the array.
typedef void* (*DeferredFinalizeAppendFunction)(void* aPointers, void* aThing);
// Called to finalize a number of objects. Slice is the number of objects
// to finalize, or if it's UINT32_MAX, all objects should be finalized.
// Return value indicates whether it finalized all objects in the buffer.
typedef bool (*DeferredFinalizeFunction)(uint32_t aSlice, void* aData);
}