Bug 340960 - Provide support for profile locking and notification. r=bsmedberg, a=mconnor. XULRunner only.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@213789 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pedemont%us.ibm.com
2006-10-18 15:24:48 +00:00
parent d5747b6673
commit 865e61cc30
20 changed files with 755 additions and 122 deletions

View File

@@ -13,9 +13,8 @@
*
* The Original Code is Java XPCOM Bindings.
*
* The Initial Developer of the Original Code is
* IBM Corporation.
* Portions created by the Initial Developer are Copyright (C) 2005
* The Initial Developer of the Original Code is IBM Corporation.
* Portions created by the Initial Developer are Copyright (C) 2006
* IBM Corporation. All Rights Reserved.
*
* Contributor(s):
@@ -46,6 +45,8 @@
#include "nsCRT.h"
#include "prmem.h"
#include "nsServiceManagerUtils.h"
#include "nsEventQueueUtils.h"
#include "nsProxyRelease.h"
static nsID nullID = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
@@ -1799,3 +1800,18 @@ JAVAPROXY_NATIVE(isSameXPCOMObject) (JNIEnv *env, jclass that,
return JNI_FALSE;
}
/**
* org.mozilla.xpcom.ProfileLock.release
*/
extern "C" NS_EXPORT void
LOCKPROXY_NATIVE(release) (JNIEnv *env, jclass that, jlong aLockObject)
{
// Need to release object on the main thread.
nsCOMPtr<nsIEventQueue> eventQ;
nsresult rv = NS_GetMainEventQ(getter_AddRefs(eventQ));
if (NS_SUCCEEDED(rv)) {
rv = NS_ProxyRelease(eventQ, NS_REINTERPRET_CAST(nsISupports*, aLockObject));
}
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to release using NS_ProxyRelease");
}