summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@redhat.com>2023-04-24 16:09:52 -0500
committerMarge Bot <marge-bot@gnome.org>2023-04-28 19:20:02 +0000
commit2e2eac5763168d411a23ae1c4ac856fadcc621b3 (patch)
tree82cb3b574da6289489340c3778466af2725017f6
parent12dea687a1e4b0f893b88e3bb3dc0755b3cae3dd (diff)
downloadepiphany-mcatanzaro/permissions-manager-asserts.tar.gz
permissions-manager: add asserts regarding storage access permission requestsmcatanzaro/permissions-manager-asserts
These permissions _could_ be stored in the permissions manager, but they're not. And it will crash if you try to do it, so let's crash a little bit sooner with an assert to document that it's not intended to be done. Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1320>
-rw-r--r--lib/ephy-permissions-manager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ephy-permissions-manager.c b/lib/ephy-permissions-manager.c
index 4e1cfd458..73b6006ae 100644
--- a/lib/ephy-permissions-manager.c
+++ b/lib/ephy-permissions-manager.c
@@ -182,6 +182,7 @@ ephy_permissions_manager_get_permission (EphyPermissionsManager *manager,
GSettings *settings;
g_assert (type != EPHY_PERMISSION_TYPE_ACCESS_WEBCAM_AND_MICROPHONE);
+ g_assert (type != EPHY_PERMISSION_TYPE_COOKIES);
settings = ephy_permissions_manager_get_settings_for_origin (manager, origin);
return g_settings_get_enum (settings, permission_type_to_string (type));
@@ -264,6 +265,7 @@ ephy_permissions_manager_set_permission (EphyPermissionsManager *manager,
GSettings *settings;
g_assert (type != EPHY_PERMISSION_TYPE_ACCESS_WEBCAM_AND_MICROPHONE);
+ g_assert (type != EPHY_PERMISSION_TYPE_COOKIES);
webkit_origin = webkit_security_origin_new_for_uri (origin);
if (webkit_origin == NULL)