summaryrefslogtreecommitdiffstats
path: root/extensions/permissions/PermissionManager.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /extensions/permissions/PermissionManager.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'extensions/permissions/PermissionManager.cpp')
-rw-r--r--extensions/permissions/PermissionManager.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/extensions/permissions/PermissionManager.cpp b/extensions/permissions/PermissionManager.cpp
index 4dd0c1acf9..be144e2dfe 100644
--- a/extensions/permissions/PermissionManager.cpp
+++ b/extensions/permissions/PermissionManager.cpp
@@ -308,17 +308,6 @@ nsresult GetPrincipalFromOrigin(const nsACString& aOrigin, bool aForceStripOA,
return NS_OK;
}
-nsresult GetPrincipal(nsIURI* aURI, bool aIsInIsolatedMozBrowserElement,
- nsIPrincipal** aPrincipal) {
- OriginAttributes attrs(aIsInIsolatedMozBrowserElement);
- nsCOMPtr<nsIPrincipal> principal =
- BasePrincipal::CreateContentPrincipal(aURI, attrs);
- NS_ENSURE_TRUE(principal, NS_ERROR_FAILURE);
-
- principal.forget(aPrincipal);
- return NS_OK;
-}
-
nsresult GetPrincipal(nsIURI* aURI, nsIPrincipal** aPrincipal) {
OriginAttributes attrs;
nsCOMPtr<nsIPrincipal> principal =
@@ -369,7 +358,6 @@ already_AddRefed<nsIURI> GetNextSubDomainURI(nsIURI* aURI) {
nsresult UpgradeHostToOriginAndInsert(
const nsACString& aHost, const nsCString& aType, uint32_t aPermission,
uint32_t aExpireType, int64_t aExpireTime, int64_t aModificationTime,
- bool aIsInIsolatedMozBrowserElement,
std::function<nsresult(const nsACString& aOrigin, const nsCString& aType,
uint32_t aPermission, uint32_t aExpireType,
int64_t aExpireTime, int64_t aModificationTime)>&&
@@ -396,8 +384,7 @@ nsresult UpgradeHostToOriginAndInsert(
}
nsCOMPtr<nsIPrincipal> principal;
- rv = GetPrincipal(uri, aIsInIsolatedMozBrowserElement,
- getter_AddRefs(principal));
+ rv = GetPrincipal(uri, getter_AddRefs(principal));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString origin;
@@ -512,8 +499,7 @@ nsresult UpgradeHostToOriginAndInsert(
// We now have a URI which we can make a nsIPrincipal out of
nsCOMPtr<nsIPrincipal> principal;
- rv = GetPrincipal(uri, aIsInIsolatedMozBrowserElement,
- getter_AddRefs(principal));
+ rv = GetPrincipal(uri, getter_AddRefs(principal));
if (NS_WARN_IF(NS_FAILED(rv))) continue;
nsAutoCString origin;
@@ -560,8 +546,7 @@ nsresult UpgradeHostToOriginAndInsert(
rv = NS_NewURI(getter_AddRefs(uri), "http://"_ns + hostSegment);
NS_ENSURE_SUCCESS(rv, rv);
- rv = GetPrincipal(uri, aIsInIsolatedMozBrowserElement,
- getter_AddRefs(principal));
+ rv = GetPrincipal(uri, getter_AddRefs(principal));
NS_ENSURE_SUCCESS(rv, rv);
rv = GetOriginFromPrincipal(principal, IsOAForceStripPermission(aType),
@@ -575,8 +560,7 @@ nsresult UpgradeHostToOriginAndInsert(
rv = NS_NewURI(getter_AddRefs(uri), "https://"_ns + hostSegment);
NS_ENSURE_SUCCESS(rv, rv);
- rv = GetPrincipal(uri, aIsInIsolatedMozBrowserElement,
- getter_AddRefs(principal));
+ rv = GetPrincipal(uri, getter_AddRefs(principal));
NS_ENSURE_SUCCESS(rv, rv);
rv = GetOriginFromPrincipal(principal, IsOAForceStripPermission(aType),
@@ -1224,7 +1208,6 @@ nsresult PermissionManager::TryInitDB(bool aRemoveFile,
entry.mExpireType = stmt->AsInt32(3);
entry.mExpireTime = stmt->AsInt64(4);
entry.mModificationTime = stmt->AsInt64(5);
- entry.mIsInBrowserElement = static_cast<bool>(stmt->AsInt32(6));
mMigrationEntries.AppendElement(entry);
}
@@ -1379,7 +1362,6 @@ nsresult PermissionManager::TryInitDB(bool aRemoveFile,
entry.mExpireType = stmt->AsInt32(3);
entry.mExpireTime = stmt->AsInt64(4);
entry.mModificationTime = stmt->AsInt64(5);
- entry.mIsInBrowserElement = static_cast<bool>(stmt->AsInt32(6));
mMigrationEntries.AppendElement(entry);
}
@@ -3068,7 +3050,7 @@ void PermissionManager::CompleteMigrations() {
for (const MigrationEntry& entry : entries) {
rv = UpgradeHostToOriginAndInsert(
entry.mHost, entry.mType, entry.mPermission, entry.mExpireType,
- entry.mExpireTime, entry.mModificationTime, entry.mIsInBrowserElement,
+ entry.mExpireTime, entry.mModificationTime,
[&](const nsACString& aOrigin, const nsCString& aType,
uint32_t aPermission, uint32_t aExpireType, int64_t aExpireTime,
int64_t aModificationTime) {
@@ -3689,7 +3671,7 @@ nsresult PermissionManager::ImportLatestDefaults() {
rv = UpgradeHostToOriginAndInsert(
entry.mHostOrOrigin, entry.mType, entry.mPermission,
- nsIPermissionManager::EXPIRE_NEVER, 0, modificationTime, false,
+ nsIPermissionManager::EXPIRE_NEVER, 0, modificationTime,
[&](const nsACString& aOrigin, const nsCString& aType,
uint32_t aPermission, uint32_t aExpireType, int64_t aExpireTime,
int64_t aModificationTime) {