Bug 869893 - Remove Off-Main-Thread XPCWrappedJS refcounting from SignRunnable. r=jedp
authorJosh Matthews <josh@joshmatthews.net>
Wed, 08 May 2013 10:50:36 -0400
changeset 142209 c0057a14ffc56f828593bf0ad224f35f601c4450
parent 142208 d95ddf1d37b09e50c3ea2a90a755c09621c81c71
child 142210 2d98636bc27bb9b5d7a06543279e6327ef31b891
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjedp
bugs869893
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 869893 - Remove Off-Main-Thread XPCWrappedJS refcounting from SignRunnable. r=jedp
toolkit/identity/IdentityCryptoService.cpp
--- a/toolkit/identity/IdentityCryptoService.cpp
+++ b/toolkit/identity/IdentityCryptoService.cpp
@@ -173,17 +173,17 @@ private:
       return;
 
     SECKEY_DestroyPrivateKey(mPrivateKey);
     mPrivateKey = NULL;
   }
 
   const nsCString mTextToSign; // in
   SECKEYPrivateKey* mPrivateKey; // in
-  const nsCOMPtr<nsIIdentitySignCallback> mCallback; // in
+  nsMainThreadPtrHandle<nsIIdentitySignCallback> mCallback; // in
   nsresult mRv; // out
   nsCString mSignature; // out
 
 private:
   SignRunnable(const SignRunnable &) MOZ_DELETE;
   void operator=(const SignRunnable &) MOZ_DELETE;
 };
 
@@ -491,17 +491,17 @@ KeyGenRunnable::Run()
   return NS_OK;
 }
 
 SignRunnable::SignRunnable(const nsACString & aText,
                            SECKEYPrivateKey * privateKey,
                            nsIIdentitySignCallback * aCallback)
   : mTextToSign(aText)
   , mPrivateKey(SECKEY_CopyPrivateKey(privateKey))
-  , mCallback(aCallback)
+  , mCallback(new nsMainThreadPtrHolder<nsIIdentitySignCallback>(aCallback))
   , mRv(NS_ERROR_NOT_INITIALIZED)
 {
 }
 
 NS_IMETHODIMP
 SignRunnable::Run()
 {
   if (!NS_IsMainThread()) {