diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /toolkit/components/places/Helpers.cpp | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/places/Helpers.cpp')
-rw-r--r-- | toolkit/components/places/Helpers.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/toolkit/components/places/Helpers.cpp b/toolkit/components/places/Helpers.cpp index 90ab263ec1..8cd019b6e1 100644 --- a/toolkit/components/places/Helpers.cpp +++ b/toolkit/components/places/Helpers.cpp @@ -10,6 +10,7 @@ #include "nsReadableUtils.h" #include "nsString.h" #include "nsNavHistory.h" +#include "nsNetUtil.h" #include "mozilla/Base64.h" #include "mozilla/HashFunctions.h" #include "mozilla/RandomNum.h" @@ -378,5 +379,26 @@ nsresult BackupDatabaseFile(nsIFile* aDBFile, const nsAString& aBackupFileName, return aDBFile->CopyTo(parentDir, fileName); } +already_AddRefed<nsIURI> GetExposableURI(nsIURI* aURI) { + MOZ_ASSERT(NS_IsMainThread()); + MOZ_ASSERT(aURI); + + nsresult rv; + nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv); + if (NS_FAILED(rv)) { + NS_WARNING("Failed to get nsIIOService"); + return nsCOMPtr<nsIURI>(aURI).forget(); + } + + nsCOMPtr<nsIURI> uri; + rv = ioService->CreateExposableURI(aURI, getter_AddRefs(uri)); + if (NS_FAILED(rv)) { + NS_WARNING("Failed to create exposable URI"); + return nsCOMPtr<nsIURI>(aURI).forget(); + } + + return uri.forget(); +} + } // namespace places } // namespace mozilla |