Bug 708326 - Use IDL for Components.utils.forceGC; r=bholley

This commit is contained in:
Ms2ger 2011-12-18 11:11:23 +01:00
parent 21ffe5b481
commit fe9b843007
2 changed files with 3 additions and 19 deletions

View File

@ -152,7 +152,7 @@ interface ScheduledGCCallback : nsISupports
/**
* interface of Components.utils
*/
[scriptable, uuid(90894460-26a2-44c2-a3fc-c96a5286614e)]
[scriptable, uuid(9e0b065d-a755-482d-ab1f-cc0f26a6fdcd)]
interface nsIXPCComponents_Utils : nsISupports
{
@ -260,6 +260,7 @@ interface nsIXPCComponents_Utils : nsISupports
*
* Force an immediate garbage collection cycle.
*/
[implicit_jscontext]
void forceGC();
/*

View File

@ -3594,26 +3594,9 @@ nsXPCComponents_Utils::GetWeakReference(xpcIJSWeakReference **_retval)
/* void forceGC (); */
NS_IMETHODIMP
nsXPCComponents_Utils::ForceGC()
nsXPCComponents_Utils::ForceGC(JSContext *cx)
{
nsXPConnect* xpc = nsXPConnect::GetXPConnect();
if (!xpc)
return NS_ERROR_FAILURE;
// get the xpconnect native call context
nsAXPCNativeCallContext *cc = nsnull;
nsresult rv = xpc->GetCurrentNativeCallContext(&cc);
if (!cc)
return rv;
// Get JSContext of current call
JSContext* cx;
cc->GetJSContext(&cx);
if (!cx)
return NS_ERROR_FAILURE;
JS_GC(cx);
return NS_OK;
}