Bug 1175860 - Add some documentation to UploadLastDir to make its workings clearer. r=baku

This commit is contained in:
Jonathan Watt
2015-06-08 14:01:01 +01:00
parent 9e2e80c211
commit f359add372
2 changed files with 14 additions and 2 deletions

View File

@@ -805,6 +805,9 @@ UploadLastDir::StoreLastUsedDirectory(nsIDocument* aDoc, nsIFile* aDir)
return NS_ERROR_OUT_OF_MEMORY;
prefValue->SetAsAString(unicodePath);
// Use the document's current load context to ensure that the content pref
// service doesn't persistently store this directory for this domain if the
// user is using private browsing:
nsCOMPtr<nsILoadContext> loadContext = aDoc->GetLoadContext();
return contentPrefService->Set(spec, CPS_PREF_NAME, prefValue, loadContext, nullptr);
}