Backed out changeset b6b9517e3d50 (bug 1110485)
authorWes Kocher <wkocher@mozilla.com>
Tue, 14 Apr 2015 15:27:37 -0700
changeset 239162 90ec95ca90ecbf2b93ffe625aca951bfb897419f
parent 239161 916eafb5ea044e5ae1a7165967d3d947f9d5b990
child 239163 b4d77e793ba74b842e9a9311de7067904dc21fdd
push id28584
push usercbook@mozilla.com
push dateWed, 15 Apr 2015 12:29:01 +0000
treeherdermozilla-central@b58b07945d30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1110485
milestone40.0a1
backs outb6b9517e3d50cdbd4d8f677a69ceeee24b197345
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
Backed out changeset b6b9517e3d50 (bug 1110485)
dom/cache/DBSchema.cpp
dom/cache/DBSchema.h
dom/cache/Manager.cpp
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -354,17 +354,17 @@ InitializeConnection(mozIStorageConnecti
 
   nsresult rv = aConn->ExecuteSimpleSQL(pragmas);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   return NS_OK;
 }
 
 nsresult
-CreateCacheId(mozIStorageConnection* aConn, CacheId* aCacheIdOut)
+CreateCache(mozIStorageConnection* aConn, CacheId* aCacheIdOut)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(aConn);
   MOZ_ASSERT(aCacheIdOut);
 
   nsresult rv = aConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
     "INSERT INTO caches DEFAULT VALUES;"
   ));
@@ -383,18 +383,18 @@ CreateCacheId(mozIStorageConnection* aCo
 
   rv = state->GetInt64(0, aCacheIdOut);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   return rv;
 }
 
 nsresult
-DeleteCacheId(mozIStorageConnection* aConn, CacheId aCacheId,
-              nsTArray<nsID>& aDeletedBodyIdListOut)
+DeleteCache(mozIStorageConnection* aConn, CacheId aCacheId,
+            nsTArray<nsID>& aDeletedBodyIdListOut)
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(aConn);
 
   // Delete the bodies explicitly as we need to read out the body IDs
   // anyway.  These body IDs must be deleted one-by-one as content may
   // still be referencing them invidivually.
   nsAutoTArray<EntryId, 256> matches;
--- a/dom/cache/DBSchema.h
+++ b/dom/cache/DBSchema.h
@@ -31,21 +31,22 @@ namespace db {
 
 nsresult
 CreateSchema(mozIStorageConnection* aConn);
 
 nsresult
 InitializeConnection(mozIStorageConnection* aConn);
 
 nsresult
-CreateCacheId(mozIStorageConnection* aConn, CacheId* aCacheIdOut);
+CreateCache(mozIStorageConnection* aConn, CacheId* aCacheIdOut);
 
+// TODO: improve naming (confusing with CacheDelete) (bug 1110485)
 nsresult
-DeleteCacheId(mozIStorageConnection* aConn, CacheId aCacheId,
-              nsTArray<nsID>& aDeletedBodyIdListOut);
+DeleteCache(mozIStorageConnection* aConn, CacheId aCacheId,
+            nsTArray<nsID>& aDeletedBodyIdListOut);
 
 // TODO: Consider removing unused IsCacheOrphaned after writing cleanup code. (bug 1110446)
 nsresult
 IsCacheOrphaned(mozIStorageConnection* aConn, CacheId aCacheId,
                 bool* aOrphanedOut);
 
 nsresult
 CacheMatch(mozIStorageConnection* aConn, CacheId aCacheId,
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -452,17 +452,17 @@ public:
 
   virtual nsresult
   RunSyncWithDBOnTarget(const QuotaInfo& aQuotaInfo, nsIFile* aDBDir,
                         mozIStorageConnection* aConn) override
   {
     mozStorageTransaction trans(aConn, false,
                                 mozIStorageConnection::TRANSACTION_IMMEDIATE);
 
-    nsresult rv = db::DeleteCacheId(aConn, mCacheId, mDeletedBodyIdList);
+    nsresult rv = db::DeleteCache(aConn, mCacheId, mDeletedBodyIdList);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
     rv = trans.Commit();
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
     return rv;
   }
 
@@ -1213,17 +1213,17 @@ public:
     bool cacheFound;
     nsresult rv = db::StorageGetCacheId(aConn, mNamespace, mArgs.key(),
                                         &cacheFound, &mCacheId);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
     if (cacheFound) {
       return rv;
     }
 
-    rv = db::CreateCacheId(aConn, &mCacheId);
+    rv = db::CreateCache(aConn, &mCacheId);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
     rv = db::StoragePutCache(aConn, mNamespace, mArgs.key(), mCacheId);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
     rv = trans.Commit();
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }