Bug 1110485 P7 Rename DeleteCache() to DeleteCacheId() better distinguish it from CacheDelete(). r=ehsan
☠☠ backed out by 90ec95ca90ec ☠ ☠
authorBen Kelly <ben@wanderview.com>
Tue, 14 Apr 2015 12:21:14 -0700
changeset 256312 b6b9517e3d50cdbd4d8f677a69ceeee24b197345
parent 256311 974c5c109a49d76a3e16332e6a6f956d443e8b0f
child 256313 e96b90efdeec98d075adcbafa9f66cd3cf88fb1e
push idunknown
push userunknown
push dateunknown
reviewersehsan
bugs1110485
milestone40.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 1110485 P7 Rename DeleteCache() to DeleteCacheId() better distinguish it from CacheDelete(). r=ehsan
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
-CreateCache(mozIStorageConnection* aConn, CacheId* aCacheIdOut)
+CreateCacheId(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 @@ CreateCache(mozIStorageConnection* aConn
 
   rv = state->GetInt64(0, aCacheIdOut);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   return rv;
 }
 
 nsresult
-DeleteCache(mozIStorageConnection* aConn, CacheId aCacheId,
-            nsTArray<nsID>& aDeletedBodyIdListOut)
+DeleteCacheId(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,22 +31,21 @@ namespace db {
 
 nsresult
 CreateSchema(mozIStorageConnection* aConn);
 
 nsresult
 InitializeConnection(mozIStorageConnection* aConn);
 
 nsresult
-CreateCache(mozIStorageConnection* aConn, CacheId* aCacheIdOut);
+CreateCacheId(mozIStorageConnection* aConn, CacheId* aCacheIdOut);
 
-// TODO: improve naming (confusing with CacheDelete) (bug 1110485)
 nsresult
-DeleteCache(mozIStorageConnection* aConn, CacheId aCacheId,
-            nsTArray<nsID>& aDeletedBodyIdListOut);
+DeleteCacheId(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::DeleteCache(aConn, mCacheId, mDeletedBodyIdList);
+    nsresult rv = db::DeleteCacheId(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::CreateCache(aConn, &mCacheId);
+    rv = db::CreateCacheId(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; }