Bug 743650 - Don't use nsPrintfCString. r=nfroyd.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Mon, 09 Apr 2012 09:56:41 -0400
changeset 94564 147324800246e0e86db097b4fb0803c3422fef64
parent 94563 575db34e12396ab28b333a9d3df2d3dd9ca13530
child 94565 9a736b04b47fb62fdf549ce697f60d8d65c49a3d
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnfroyd
bugs743650
milestone14.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 743650 - Don't use nsPrintfCString. r=nfroyd.
storage/src/VacuumManager.cpp
--- a/storage/src/VacuumManager.cpp
+++ b/storage/src/VacuumManager.cpp
@@ -37,17 +37,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "VacuumManager.h"
 
 #include "mozilla/Services.h"
 #include "mozilla/Preferences.h"
 #include "nsIObserverService.h"
-#include "nsPrintfCString.h"
 #include "nsIFile.h"
 #include "nsThreadUtils.h"
 #include "prlog.h"
 
 #include "mozStorageConnection.h"
 #include "mozIStorageStatement.h"
 #include "mozIStorageAsyncStatement.h"
 #include "mozIStoragePendingStatement.h"
@@ -225,19 +224,21 @@ Vacuumer::execute()
       os->NotifyObservers(nsnull, OBSERVER_TOPIC_HEAVY_IO,
                           OBSERVER_DATA_VACUUM_BEGIN.get());
     MOZ_ASSERT(NS_SUCCEEDED(rv), "Should be able to notify");
   }
 
   // Execute the statements separately, since the pragma may conflict with the
   // vacuum, if they are executed in the same transaction.
   nsCOMPtr<mozIStorageAsyncStatement> pageSizeStmt;
-  rv = mDBConn->CreateAsyncStatement(nsPrintfCString(
-    MOZ_STORAGE_UNIQUIFY_QUERY_STR "PRAGMA page_size = %ld", expectedPageSize
-  ), getter_AddRefs(pageSizeStmt));
+  nsCAutoString pageSizeQuery(MOZ_STORAGE_UNIQUIFY_QUERY_STR
+                              "PRAGMA page_size = ");
+  pageSizeQuery.AppendInt(expectedPageSize);
+  rv = mDBConn->CreateAsyncStatement(pageSizeQuery,
+                                     getter_AddRefs(pageSizeStmt));
   NS_ENSURE_SUCCESS(rv, false);
   nsCOMPtr<BaseCallback> callback = new BaseCallback();
   nsCOMPtr<mozIStoragePendingStatement> ps;
   rv = pageSizeStmt->ExecuteAsync(callback, getter_AddRefs(ps));
   NS_ENSURE_SUCCESS(rv, false);
 
   nsCOMPtr<mozIStorageAsyncStatement> stmt;
   rv = mDBConn->CreateAsyncStatement(NS_LITERAL_CSTRING(