зеркало из https://github.com/mozilla/gecko-dev.git
Bug 749385 - use deferred release in nsHTMLDocumentSH::ReleaseDocument. r=peterv
This commit is contained in:
Родитель
51db5f5ef1
Коммит
32c90ebc36
|
@ -9095,9 +9095,10 @@ nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JSHandleObject obj, JSHan
|
||||||
void
|
void
|
||||||
nsHTMLDocumentSH::ReleaseDocument(JSFreeOp *fop, JSObject *obj)
|
nsHTMLDocumentSH::ReleaseDocument(JSFreeOp *fop, JSObject *obj)
|
||||||
{
|
{
|
||||||
nsIHTMLDocument *doc = (nsIHTMLDocument *)::JS_GetPrivate(obj);
|
nsIHTMLDocument *doc = static_cast<nsIHTMLDocument *>(JS_GetPrivate(obj));
|
||||||
|
if (doc) {
|
||||||
NS_IF_RELEASE(doc);
|
xpc::DeferredRelease(doc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JSBool
|
JSBool
|
||||||
|
|
|
@ -2128,7 +2128,7 @@ XPCJSRuntime::OnJSContextNew(JSContext *cx)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSBool
|
bool
|
||||||
XPCJSRuntime::DeferredRelease(nsISupports* obj)
|
XPCJSRuntime::DeferredRelease(nsISupports* obj)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(obj, "bad param");
|
NS_ASSERTION(obj, "bad param");
|
||||||
|
|
|
@ -2558,6 +2558,12 @@ nsXPConnect::GetCaller(JSContext **aJSContext, JSObject **aObj)
|
||||||
|
|
||||||
namespace xpc {
|
namespace xpc {
|
||||||
|
|
||||||
|
bool
|
||||||
|
DeferredRelease(nsISupports *obj)
|
||||||
|
{
|
||||||
|
return nsXPConnect::GetRuntimeInstance()->DeferredRelease(obj);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Base64Encode(JSContext *cx, JS::Value val, JS::Value *out)
|
Base64Encode(JSContext *cx, JS::Value val, JS::Value *out)
|
||||||
{
|
{
|
||||||
|
|
|
@ -698,7 +698,7 @@ public:
|
||||||
|
|
||||||
JSBool OnJSContextNew(JSContext* cx);
|
JSBool OnJSContextNew(JSContext* cx);
|
||||||
|
|
||||||
JSBool DeferredRelease(nsISupports* obj);
|
bool DeferredRelease(nsISupports* obj);
|
||||||
|
|
||||||
JSBool GetDoingFinalization() const {return mDoingFinalization;}
|
JSBool GetDoingFinalization() const {return mDoingFinalization;}
|
||||||
|
|
||||||
|
|
|
@ -219,6 +219,8 @@ class nsIMemoryMultiReporterCallback;
|
||||||
|
|
||||||
namespace xpc {
|
namespace xpc {
|
||||||
|
|
||||||
|
bool DeferredRelease(nsISupports *obj);
|
||||||
|
|
||||||
// If these functions return false, then an exception will be set on cx.
|
// If these functions return false, then an exception will be set on cx.
|
||||||
bool Base64Encode(JSContext *cx, JS::Value val, JS::Value *out);
|
bool Base64Encode(JSContext *cx, JS::Value val, JS::Value *out);
|
||||||
bool Base64Decode(JSContext *cx, JS::Value val, JS::Value *out);
|
bool Base64Decode(JSContext *cx, JS::Value val, JS::Value *out);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче