Backed out changeset 4a0bf3ffd767 due to test crashes.
authorL. David Baron <dbaron@dbaron.org>
Thu, 19 Nov 2009 13:51:31 -0800
changeset 35148 83a14d23f6cd6fa02684e892cda2d794412db101
parent 35143 4a0bf3ffd767d43551955762e1111afa12f4580c
child 35149 76d83d28411e3346cc7862617eb10d7742b4b1cb
push id10440
push userdbaron@mozilla.com
push dateThu, 19 Nov 2009 21:52:07 +0000
treeherdermozilla-central@76d83d28411e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.3a1pre
backs out4a0bf3ffd767d43551955762e1111afa12f4580c
Backed out changeset 4a0bf3ffd767 due to test crashes.
storage/src/mozStorageStatement.cpp
--- a/storage/src/mozStorageStatement.cpp
+++ b/storage/src/mozStorageStatement.cpp
@@ -38,17 +38,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include <stdio.h>
 
 #include "nsError.h"
 #include "nsMemory.h"
-#include "nsProxyRelease.h"
 #include "nsThreadUtils.h"
 #include "nsIClassInfoImpl.h"
 #include "nsIProgrammingLanguage.h"
 
 #include "mozIStorageError.h"
 
 #include "mozStorageBindingParams.h"
 #include "mozStorageConnection.h"
@@ -73,43 +72,28 @@ namespace storage {
 namespace {
 
 /**
  * Used to finalize an asynchronous statement on the background thread.
  */
 class AsyncStatementFinalizer : public nsRunnable
 {
 public:
-  /**
-   * Constructor for the event.
-   *
-   * @param aStatement
-   *        The sqlite3_stmt to finalize on the background thread.
-   * @param aParent
-   *        The object that owns aStatement.  It will be released on the calling
-   *        thread.
-   */
-  AsyncStatementFinalizer(sqlite3_stmt *aStatement,
-                          nsISupports *aParent)
+  AsyncStatementFinalizer(sqlite3_stmt *aStatement)
   : mStatement(aStatement)
-  , mParent(aParent)
-  , mCallingThread(do_GetCurrentThread())
   {
   }
 
   NS_IMETHOD Run()
   {
     (void)::sqlite3_finalize(mStatement);
-    (void)::NS_ProxyRelease(mCallingThread, mParent);
     return NS_OK;
   }
 private:
   sqlite3_stmt *mStatement;
-  nsCOMPtr<nsISupports> mParent;
-  nsCOMPtr<nsIThread> mCallingThread;
 };
 
 } // anonymous namespace
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsIClassInfo
 
 NS_IMPL_CI_INTERFACE_GETTER2(
@@ -412,17 +396,17 @@ Statement::Finalize()
     if (!target) {
       // However, if we cannot get the background thread, we have to assume it
       // has been shutdown (or is in the process of doing so).  As a result, we
       // should just finalize it here and now.
       (void)::sqlite3_finalize(mCachedAsyncStatement);
     }
     else {
       nsCOMPtr<nsIRunnable> event =
-        new AsyncStatementFinalizer(mCachedAsyncStatement, this);
+        new AsyncStatementFinalizer(mCachedAsyncStatement);
       NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
 
       nsresult rv = target->Dispatch(event, NS_DISPATCH_NORMAL);
       NS_ENSURE_SUCCESS(rv, rv);
       mCachedAsyncStatement = NULL;
     }
   }