Backed out changeset e8de5745c5c3 (bug 1110485)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 15 Apr 2015 09:54:27 +0200
changeset 256385 8b4e26471d7cb24d338a4e19946f777f23e72326
parent 256384 968dd6ff44f424f7781f3cb4694d668b9e5b8a1d
child 256386 9c0e5b3f8ed5629f11f0b709486c7a1159262ae2
push idunknown
push userunknown
push dateunknown
bugs1110485
milestone40.0a1
backs oute8de5745c5c32fe5760a61597968afca68837ec3
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 e8de5745c5c3 (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; }