зеркало из https://github.com/mozilla/pjs.git
Bug 708326 - Use IDL for Components.utils.forceGC; r=bholley
This commit is contained in:
Родитель
941c5e0cb4
Коммит
498248fe61
|
@ -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();
|
||||
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче