Bug 774250: Use GetPath instead of GetNativePath so that IndexedDB works for people with non-ASCII usernames. r=bent

--HG--
extra : rebase_source : 644ec1830e0725e37ee4cceefd113b61b64158a3
This commit is contained in:
Kyle Huey 2012-09-19 14:02:08 -07:00
parent 70ba385729
commit bd5877ee3f
2 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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;