From bd5877ee3ffb03d23ca9c15a43c028ce8fae21ca Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Wed, 19 Sep 2012 14:02:08 -0700 Subject: [PATCH] Bug 774250: Use GetPath instead of GetNativePath so that IndexedDB works for people with non-ASCII usernames. r=bent --HG-- extra : rebase_source : 644ec1830e0725e37ee4cceefd113b61b64158a3 --- dom/indexedDB/IndexedDatabaseManager.cpp | 6 +++--- storage/src/mozStorageService.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dom/indexedDB/IndexedDatabaseManager.cpp b/dom/indexedDB/IndexedDatabaseManager.cpp index 8e20dce49df..e450a2cfe98 100644 --- a/dom/indexedDB/IndexedDatabaseManager.cpp +++ b/dom/indexedDB/IndexedDatabaseManager.cpp @@ -781,8 +781,8 @@ IndexedDatabaseManager::EnsureOriginIsInitialized(const nsACString& aOrigin, rv = patternFile->Append(NS_LITERAL_STRING("*")); NS_ENSURE_SUCCESS(rv, rv); - nsCString pattern; - rv = patternFile->GetNativePath(pattern); + nsString pattern; + rv = patternFile->GetPath(pattern); NS_ENSURE_SUCCESS(rv, rv); // Now tell SQLite to start tracking this pattern for content. @@ -791,7 +791,7 @@ IndexedDatabaseManager::EnsureOriginIsInitialized(const nsACString& aOrigin, NS_ENSURE_TRUE(ss, NS_ERROR_FAILURE); if (aPrivilege != Chrome) { - rv = ss->SetQuotaForFilenamePattern(pattern, + rv = ss->SetQuotaForFilenamePattern(NS_ConvertUTF16toUTF8(pattern), GetIndexedDBQuotaMB() * 1024 * 1024, mQuotaCallbackSingleton, nullptr); NS_ENSURE_SUCCESS(rv, rv); diff --git a/storage/src/mozStorageService.cpp b/storage/src/mozStorageService.cpp index 0ca8d4efdf2..baccbba4b2b 100644 --- a/storage/src/mozStorageService.cpp +++ b/storage/src/mozStorageService.cpp @@ -894,11 +894,11 @@ Service::UpdateQuotaInformationForFile(nsIFile *aFile) { NS_ENSURE_ARG_POINTER(aFile); - nsCString path; - nsresult rv = aFile->GetNativePath(path); + nsString path; + nsresult rv = aFile->GetPath(path); NS_ENSURE_SUCCESS(rv, rv); - int rc = ::sqlite3_quota_file(PromiseFlatCString(path).get()); + int rc = ::sqlite3_quota_file(NS_ConvertUTF16toUTF8(path).get()); NS_ENSURE_TRUE(rc == SQLITE_OK, convertResultCode(rc)); return NS_OK;