Backout changeset c1cd7da16cd6 (bug 774250) for Linux Moth orange
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 19 Sep 2012 20:25:56 -0400
changeset 107674 d6716083397b358a317d4f47ccacf3cb8195c26c
parent 107673 0a66375a627a6c81a38c39bff07e2baf28b24879
child 107675 989003f06039c5289e454849eba20b7977c74529
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
bugs774250
milestone18.0a1
backs outc1cd7da16cd6c9b9e233d6e50c64b036fa572985
Backout changeset c1cd7da16cd6 (bug 774250) for Linux Moth orange
dom/indexedDB/IndexedDatabaseManager.cpp
storage/src/mozStorageService.cpp
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -776,27 +776,27 @@ IndexedDatabaseManager::EnsureOriginIsIn
   // First figure out the filename pattern we'll use.
   nsCOMPtr<nsIFile> patternFile;
   rv = directory->Clone(getter_AddRefs(patternFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = patternFile->Append(NS_LITERAL_STRING("*"));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsString pattern;
-  rv = patternFile->GetPath(pattern);
+  nsCString pattern;
+  rv = patternFile->GetNativePath(pattern);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Now tell SQLite to start tracking this pattern for content.
   nsCOMPtr<mozIStorageServiceQuotaManagement> ss =
     do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID);
   NS_ENSURE_TRUE(ss, NS_ERROR_FAILURE);
 
   if (aPrivilege != Chrome) {
-    rv = ss->SetQuotaForFilenamePattern(NS_ConvertUTF16toUTF8(pattern),
+    rv = ss->SetQuotaForFilenamePattern(pattern,
                                         GetIndexedDBQuotaMB() * 1024 * 1024,
                                         mQuotaCallbackSingleton, nullptr);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // We need to see if there are any files in the directory already. If they
   // are database files then we need to cleanup stored files (if it's needed)
   // and also tell SQLite about all of them.
--- a/storage/src/mozStorageService.cpp
+++ b/storage/src/mozStorageService.cpp
@@ -889,20 +889,20 @@ Service::SetQuotaForFilenamePattern(cons
   return NS_OK;
 }
 
 NS_IMETHODIMP
 Service::UpdateQuotaInformationForFile(nsIFile *aFile)
 {
   NS_ENSURE_ARG_POINTER(aFile);
 
-  nsString path;
-  nsresult rv = aFile->GetPath(path);
+  nsCString path;
+  nsresult rv = aFile->GetNativePath(path);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  int rc = ::sqlite3_quota_file(NS_ConvertUTF16toUTF8(path).get());
+  int rc = ::sqlite3_quota_file(PromiseFlatCString(path).get());
   NS_ENSURE_TRUE(rc == SQLITE_OK, convertResultCode(rc));
 
   return NS_OK;
 }
 
 } // namespace storage
 } // namespace mozilla