diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /modules/libpref/Preferences.h | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/libpref/Preferences.h')
-rw-r--r-- | modules/libpref/Preferences.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/libpref/Preferences.h b/modules/libpref/Preferences.h index 81c99590da..c675195d57 100644 --- a/modules/libpref/Preferences.h +++ b/modules/libpref/Preferences.h @@ -15,6 +15,7 @@ #include "mozilla/Atomics.h" #include "mozilla/MemoryReporting.h" +#include "mozilla/MozPromise.h" #include "mozilla/StaticPtr.h" #include "nsCOMPtr.h" #include "nsIObserver.h" @@ -97,6 +98,8 @@ class Preferences final : public nsIPrefService, friend class ::nsPrefBranch; public: + using WritePrefFilePromise = MozPromise<bool, nsresult, false>; + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPREFSERVICE NS_FORWARD_NSIPREFBRANCH(mRootBranch->) @@ -454,7 +457,9 @@ class Preferences final : public nsIPrefService, // Off main thread is only respected for the default aFile value (nullptr). nsresult SavePrefFileInternal(nsIFile* aFile, SaveMethod aSaveMethod); - nsresult WritePrefFile(nsIFile* aFile, SaveMethod aSaveMethod); + nsresult WritePrefFile( + nsIFile* aFile, SaveMethod aSaveMethod, + UniquePtr<MozPromiseHolder<WritePrefFilePromise>> aPromise = nullptr); nsresult ResetUserPrefs(); |