Bug 869928 - Remove Off-Main-Thread XPCWrappedJS refcounting from OpenSignedJARFileTask. r=bsmith
authorJosh Matthews <josh@joshmatthews.net>
Thu, 09 May 2013 15:43:25 -0400
changeset 142370 7fa500e12a386c35928fc8f5b0ebf8b3f50ce551
parent 142369 ae045b8a759b32ad45c53ba125547b0fb90bc8a6
child 142371 1bc459138617b42345ff7d27e01aa05776582993
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)
reviewersbsmith
bugs869928
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 869928 - Remove Off-Main-Thread XPCWrappedJS refcounting from OpenSignedJARFileTask. r=bsmith
security/manager/ssl/src/JARSignatureVerification.cpp
--- a/security/manager/ssl/src/JARSignatureVerification.cpp
+++ b/security/manager/ssl/src/JARSignatureVerification.cpp
@@ -15,16 +15,17 @@
 #include "nsComponentManagerUtils.h"
 #include "nsCOMPtr.h"
 #include "nsHashKeys.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsIStringEnumerator.h"
 #include "nsIZipReader.h"
 #include "nsNSSCertificate.h"
+#include "nsProxyRelease.h"
 #include "nsString.h"
 #include "nsTHashtable.h"
 #include "ScopedNSSTypes.h"
 
 #include "base64.h"
 #include "secmime.h"
 #include "plstr.h"
 #include "prlog.h"
@@ -722,17 +723,17 @@ OpenSignedJARFile(nsIFile * aJarFile,
 }
 
 class OpenSignedJARFileTask MOZ_FINAL : public CryptoTask
 {
 public:
   OpenSignedJARFileTask(nsIFile * aJarFile,
                         nsIOpenSignedJARFileCallback * aCallback)
     : mJarFile(aJarFile)
-    , mCallback(aCallback)
+    , mCallback(new nsMainThreadPtrHolder<nsIOpenSignedJARFileCallback>(aCallback))
   {
   }
 
 private:
   virtual nsresult CalculateResult() MOZ_OVERRIDE
   {
     return OpenSignedJARFile(mJarFile, getter_AddRefs(mZipReader),
                              getter_AddRefs(mSignerCert));
@@ -743,17 +744,17 @@ private:
   virtual void ReleaseNSSResources() { }
 
   virtual void CallCallback(nsresult rv)
   {
     (void) mCallback->OpenSignedJARFileFinished(rv, mZipReader, mSignerCert);
   }
 
   const nsCOMPtr<nsIFile> mJarFile;
-  const nsCOMPtr<nsIOpenSignedJARFileCallback> mCallback;
+  nsMainThreadPtrHandle<nsIOpenSignedJARFileCallback> mCallback;
   nsCOMPtr<nsIZipReader> mZipReader; // out
   nsCOMPtr<nsIX509Cert3> mSignerCert; // out
 };
 
 } // unnamed namespace
 
 NS_IMETHODIMP
 nsNSSCertificateDB::OpenSignedJARFileAsync(