зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1175860 - Add some documentation to UploadLastDir to make its workings clearer. r=baku
This commit is contained in:
Родитель
76297166d8
Коммит
a62bfe14df
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -39,8 +39,17 @@ class Date;
|
|||
class File;
|
||||
class FileList;
|
||||
|
||||
class UploadLastDir final : public nsIObserver, public nsSupportsWeakReference {
|
||||
|
||||
/**
|
||||
* A class we use to create a singleton object that is used to keep track of
|
||||
* the last directory from which the user has picked files (via
|
||||
* <input type=file>) on a per-domain basis. The implementation uses
|
||||
* nsIContentPrefService2/NS_CONTENT_PREF_SERVICE_CONTRACTID to store the last
|
||||
* directory per-domain, and to ensure that whether the directories are
|
||||
* persistently saved (saved across sessions) or not honors whether or not the
|
||||
* page is being viewed in private browsing.
|
||||
*/
|
||||
class UploadLastDir final : public nsIObserver, public nsSupportsWeakReference
|
||||
{
|
||||
~UploadLastDir() {}
|
||||
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче