Bug 1184607 P7.3 Rename Cache "max wipe version" constant to "first shipped version". r=ehsan
authorBen Kelly <ben@wanderview.com>
Mon, 31 Aug 2015 14:26:30 -0700
changeset 280144 95fed4c06038b5b6bce9f5e50d88ea51d9cd8e6e
parent 280143 35262b99f9c712c89fb2a268fca93d52acafdbff
child 280145 4ab4edf1f7307452c3a773c00283e048bf40690b
push idunknown
push userunknown
push dateunknown
reviewersehsan
bugs1184607
milestone43.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 1184607 P7.3 Rename Cache "max wipe version" constant to "first shipped version". r=ehsan
dom/cache/DBAction.cpp
dom/cache/DBSchema.cpp
dom/cache/DBSchema.h
--- a/dom/cache/DBAction.cpp
+++ b/dom/cache/DBAction.cpp
@@ -165,17 +165,17 @@ DBAction::OpenConnection(const QuotaInfo
     rv = ss->OpenDatabaseWithFileURL(dbFileUrl, getter_AddRefs(conn));
   }
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
   // Check the schema to make sure it is not too old.
   int32_t schemaVersion = 0;
   rv = conn->GetSchemaVersion(&schemaVersion);
   if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
-  if (schemaVersion > 0 && schemaVersion < db::kMaxWipeSchemaVersion) {
+  if (schemaVersion > 0 && schemaVersion < db::kFirstShippedSchemaVersion) {
     conn = nullptr;
     rv = WipeDatabase(dbFile, aDBDir);
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
 
     rv = ss->OpenDatabaseWithFileURL(dbFileUrl, getter_AddRefs(conn));
     if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
   }
 
--- a/dom/cache/DBSchema.cpp
+++ b/dom/cache/DBSchema.cpp
@@ -26,17 +26,17 @@
 #include "mozilla/dom/ResponseBinding.h"
 #include "nsIContentPolicy.h"
 
 namespace mozilla {
 namespace dom {
 namespace cache {
 namespace db {
 
-const int32_t kMaxWipeSchemaVersion = 15;
+const int32_t kFirstShippedSchemaVersion = 15;
 
 namespace {
 
 const int32_t kLatestSchemaVersion = 15;
 
 // ---------
 // The following constants define the SQL schema.  These are defined in the
 // same order the SQL should be executed in CreateSchema().  They are broken
--- a/dom/cache/DBSchema.h
+++ b/dom/cache/DBSchema.h
@@ -111,17 +111,18 @@ StorageForgetCache(mozIStorageConnection
 nsresult
 StorageGetKeys(mozIStorageConnection* aConn, Namespace aNamespace,
                nsTArray<nsString>& aKeysOut);
 
 // Note, this works best when its NOT executed within a transaction.
 nsresult
 IncrementalVacuum(mozIStorageConnection* aConn);
 
-// We will wipe out databases with a schema versions less than this.
-extern const int32_t kMaxWipeSchemaVersion;
+// We will wipe out databases with a schema versions less than this.  Newer
+// versions will be migrated on open to the latest schema version.
+extern const int32_t kFirstShippedSchemaVersion;
 
 } // namespace db
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_cache_DBSchema_h