Bug 865188 - Remove Storage support for profile special database. r=mak
authorRoberta De Viti <r.deviti@gmail.com>
Thu, 11 Jul 2013 10:00:48 +0200
changeset 138133 aeab42c594231c6aab336a74f33a336041a9a2f6
parent 138132 4c2d85b34ff82254da2e078db9e9b7a98718f5dc
child 138134 80f127b3950fa4736b0134bd59e72e35545a25e2
push id24945
push userryanvm@gmail.com
push dateFri, 12 Jul 2013 01:55:19 +0000
treeherdermozilla-central@9db9da2ecca0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs865188
milestone25.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 865188 - Remove Storage support for profile special database. r=mak
profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp
storage/public/mozIStorageService.idl
storage/src/mozStorageService.cpp
toolkit/xre/nsXREDirProvider.cpp
xpcom/io/nsAppDirectoryServiceDefs.h
--- a/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp
+++ b/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp
@@ -18,17 +18,16 @@
 #define PREFS_FILE_50_NAME           NS_LITERAL_CSTRING("prefs.js")
 #define USER_CHROME_DIR_50_NAME      NS_LITERAL_CSTRING("chrome")
 #define LOCAL_STORE_FILE_50_NAME     NS_LITERAL_CSTRING("localstore.rdf")
 #define PANELS_FILE_50_NAME          NS_LITERAL_CSTRING("panels.rdf")
 #define MIME_TYPES_FILE_50_NAME      NS_LITERAL_CSTRING("mimeTypes.rdf")
 #define BOOKMARKS_FILE_50_NAME       NS_LITERAL_CSTRING("bookmarks.html")
 #define DOWNLOADS_FILE_50_NAME       NS_LITERAL_CSTRING("downloads.rdf")
 #define SEARCH_FILE_50_NAME          NS_LITERAL_CSTRING("search.rdf" )
-#define STORAGE_FILE_50_NAME         NS_LITERAL_CSTRING("storage.sdb")
 
 //*****************************************************************************
 // nsProfileDirServiceProvider::nsProfileDirServiceProvider
 //*****************************************************************************
 
 nsProfileDirServiceProvider::nsProfileDirServiceProvider(bool aNotifyObservers) :
 #ifdef MOZ_PROFILELOCKING
   mProfileDirLock(nullptr),
@@ -221,21 +220,16 @@ nsProfileDirServiceProvider::GetFile(con
   else if (strcmp(prop, NS_APP_SEARCH_50_FILE) == 0) {
     rv = domainDir->Clone(getter_AddRefs(localFile));
     if (NS_SUCCEEDED(rv)) {
       rv = localFile->AppendNative(SEARCH_FILE_50_NAME);
       if (NS_SUCCEEDED(rv))
         rv = EnsureProfileFileExists(localFile, domainDir);
     }
   }
-  else if (strcmp(prop, NS_APP_STORAGE_50_FILE) == 0) {
-    rv = domainDir->Clone(getter_AddRefs(localFile));
-    if (NS_SUCCEEDED(rv))
-      rv = localFile->AppendNative(STORAGE_FILE_50_NAME);
-  }
 
   
   if (localFile && NS_SUCCEEDED(rv))
     return CallQueryInterface(localFile, _retval);
 
   return rv;
 }
 
--- a/storage/public/mozIStorageService.idl
+++ b/storage/public/mozIStorageService.idl
@@ -71,17 +71,17 @@ interface mozIStorageService : nsISuppor
    */
   void openAsyncDatabase(in nsIVariant aDatabaseStore,
                          [optional] in nsIPropertyBag2 aOptions,
                          in mozIStorageCompletionCallback aCallback);
   /**
    * Get a connection to a named special database storage.
    *
    * @param aStorageKey a string key identifying the type of storage
-   * requested.  Valid values include: "profile", "memory".
+   * requested.  Valid values include: "memory".
    *
    * @see openDatabase for restrictions on how database connections may be
    * used. For the profile database, you should only access it from the main
    * thread since other callers may also have connections.
    *
    * @returns a new mozIStorageConnection for the requested
    * storage database.
    *
@@ -184,11 +184,10 @@ interface mozIStorageService : nsISuppor
    */
   nsIFile backupDatabaseFile(in nsIFile aDBFile, in AString aBackupFileName,
                              [optional] in nsIFile aBackupParentDirectory);
 };
 
 %{C++
 
 #define MOZ_STORAGE_MEMORY_STORAGE_KEY    "memory"
-#define MOZ_STORAGE_PROFILE_STORAGE_KEY   "profile"
 
 %}
--- a/storage/src/mozStorageService.cpp
+++ b/storage/src/mozStorageService.cpp
@@ -614,38 +614,28 @@ Service::getLocaleCollation()
   }
 
   return mLocaleCollation;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// mozIStorageService
 
-#ifndef NS_APP_STORAGE_50_FILE
-#define NS_APP_STORAGE_50_FILE "UStor"
-#endif
 
 NS_IMETHODIMP
 Service::OpenSpecialDatabase(const char *aStorageKey,
                              mozIStorageConnection **_connection)
 {
   nsresult rv;
 
   nsCOMPtr<nsIFile> storageFile;
   if (::strcmp(aStorageKey, "memory") == 0) {
     // just fall through with NULL storageFile, this will cause the storage
     // connection to use a memory DB.
   }
-  else if (::strcmp(aStorageKey, "profile") == 0) {
-    rv = NS_GetSpecialDirectory(NS_APP_STORAGE_50_FILE,
-                                getter_AddRefs(storageFile));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    // fall through to DB initialization
-  }
   else {
     return NS_ERROR_INVALID_ARG;
   }
 
   nsRefPtr<Connection> msc = new Connection(this, SQLITE_OPEN_READWRITE, false);
 
   rv = storageFile ? msc->initialize(storageFile) : msc->initialize();
   NS_ENSURE_SUCCESS(rv, rv);
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -414,19 +414,16 @@ nsXREDirProvider::GetFile(const char* aP
         ensureFilePermissions = true;
       }
     }
     else if (!strcmp(aProperty, NS_APP_USER_MIMETYPES_50_FILE)) {
       rv = file->AppendNative(NS_LITERAL_CSTRING("mimeTypes.rdf"));
       EnsureProfileFileExists(file);
       ensureFilePermissions = true;
     }
-    else if (!strcmp(aProperty, NS_APP_STORAGE_50_FILE)) {
-      rv = file->AppendNative(NS_LITERAL_CSTRING("storage.sdb"));
-    }
     else if (!strcmp(aProperty, NS_APP_DOWNLOADS_50_FILE)) {
       rv = file->AppendNative(NS_LITERAL_CSTRING("downloads.rdf"));
     }
     else if (!strcmp(aProperty, NS_APP_PREFS_OVERRIDE_DIR)) {
       rv = mProfileDir->Clone(getter_AddRefs(file));
       nsresult tmp = file->AppendNative(NS_LITERAL_CSTRING(PREF_OVERRIDE_DIRNAME));
       if (NS_FAILED(tmp)) {
         rv = tmp;
--- a/xpcom/io/nsAppDirectoryServiceDefs.h
+++ b/xpcom/io/nsAppDirectoryServiceDefs.h
@@ -80,14 +80,12 @@
 #define NS_APP_BOOKMARKS_50_FILE                "BMarks"
 
 #define NS_APP_DOWNLOADS_50_FILE                "DLoads"
          
 #define NS_APP_SEARCH_50_FILE                   "SrchF"
          
 #define NS_APP_INSTALL_CLEANUP_DIR              "XPIClnupD"  //location of xpicleanup.dat xpicleanup.exe 
 
-#define NS_APP_STORAGE_50_FILE                  "UStor" // sqlite database used as mozStorage profile db
-
 #define NS_APP_INDEXEDDB_PARENT_DIR             "indexedDBPDir"
 
 #define NS_APP_PERMISSION_PARENT_DIR            "permissionDBPDir"
 #endif