Bug 340960 - Provide proper profile locking and notification. r=bsmedberg. XULRunner only.

git-svn-id: svn://10.0.0.236/trunk@213788 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pedemont%us.ibm.com
2006-10-18 15:03:50 +00:00
parent 3dd746d812
commit 7b906e6ae0
20 changed files with 623 additions and 176 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 "nsThreadUtils.h"
#include "nsProxyRelease.h"
static nsID nullID = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
@@ -1742,3 +1743,17 @@ 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.
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIThread> thread = do_GetMainThread();
if (thread) {
rv = NS_ProxyRelease(thread, NS_REINTERPRET_CAST(nsISupports*, aLockObject));
}
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to release using NS_ProxyRelease");
}