Bug 830983 - Prevent removing in-memory app permissions when deleting only its in-browser permissions., r=sicking
☠☠ backed out by 3702b7ead05e ☠ ☠
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 18 Jan 2013 11:04:40 +0100
changeset 119246 aa20a6097d0b4e274fd1999bedd13e18f2a513fc
parent 119245 c2636bf84b4bd402b5b0e28ca6b803ce8c09769e
child 119247 3657968244936545c96954dda2046219d99f6d30
push id24195
push userMs2ger@gmail.com
push dateSat, 19 Jan 2013 16:10:11 +0000
treeherdermozilla-central@02e12a80aef9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs830983
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 830983 - Prevent removing in-memory app permissions when deleting only its in-browser permissions., r=sicking
extensions/cookie/nsPermissionManager.cpp
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -1226,16 +1226,19 @@ nsPermissionManager::RemovePermissionsFo
     nsAutoCString host;
     bool isInBrowserElement;
     nsAutoCString type;
 
     data.permissions[i]->GetHost(host);
     data.permissions[i]->GetIsInBrowserElement(&isInBrowserElement);
     data.permissions[i]->GetType(type);
 
+    if (aBrowserOnly && !isInBrowserElement)
+      continue;
+
     nsCOMPtr<nsIPrincipal> principal;
     if (NS_FAILED(GetPrincipal(host, aAppId, isInBrowserElement,
                                getter_AddRefs(principal)))) {
       NS_ERROR("GetPrincipal() failed!");
       continue;
     }
 
     AddInternal(principal,