Bug 749385 - use deferred release in nsHTMLDocumentSH::ReleaseDocument. r=peterv

This commit is contained in:
Andrew McCreight 2012-05-18 15:00:19 -07:00
Родитель 51db5f5ef1
Коммит 32c90ebc36
5 изменённых файлов: 14 добавлений и 5 удалений

Просмотреть файл

@ -9095,9 +9095,10 @@ nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JSHandleObject obj, JSHan
void
nsHTMLDocumentSH::ReleaseDocument(JSFreeOp *fop, JSObject *obj)
{
nsIHTMLDocument *doc = (nsIHTMLDocument *)::JS_GetPrivate(obj);
NS_IF_RELEASE(doc);
nsIHTMLDocument *doc = static_cast<nsIHTMLDocument *>(JS_GetPrivate(obj));
if (doc) {
xpc::DeferredRelease(doc);
}
}
JSBool

Просмотреть файл

@ -2128,7 +2128,7 @@ XPCJSRuntime::OnJSContextNew(JSContext *cx)
return true;
}
JSBool
bool
XPCJSRuntime::DeferredRelease(nsISupports* obj)
{
NS_ASSERTION(obj, "bad param");

Просмотреть файл

@ -2558,6 +2558,12 @@ nsXPConnect::GetCaller(JSContext **aJSContext, JSObject **aObj)
namespace xpc {
bool
DeferredRelease(nsISupports *obj)
{
return nsXPConnect::GetRuntimeInstance()->DeferredRelease(obj);
}
bool
Base64Encode(JSContext *cx, JS::Value val, JS::Value *out)
{

Просмотреть файл

@ -698,7 +698,7 @@ public:
JSBool OnJSContextNew(JSContext* cx);
JSBool DeferredRelease(nsISupports* obj);
bool DeferredRelease(nsISupports* obj);
JSBool GetDoingFinalization() const {return mDoingFinalization;}

Просмотреть файл

@ -219,6 +219,8 @@ class nsIMemoryMultiReporterCallback;
namespace xpc {
bool DeferredRelease(nsISupports *obj);
// If these functions return false, then an exception will be set on cx.
bool Base64Encode(JSContext *cx, JS::Value val, JS::Value *out);
bool Base64Decode(JSContext *cx, JS::Value val, JS::Value *out);