Backout bug 1170200 because of test failures on a CLOSED TREE
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 03 Jul 2015 16:42:11 -0400
changeset 251349 057f0bd4075c27aec5f5c618553730de463b436a
parent 251348 3d5f3ef8315024cb63f1874ed3ecd5182b63e989
child 251350 01c9c00474195e70321329694c3a0ff7e0585b6a
push id61838
push usereakhgari@mozilla.com
push dateFri, 03 Jul 2015 20:44:12 +0000
treeherdermozilla-inbound@057f0bd4075c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1170200
milestone42.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
Backout bug 1170200 because of test failures on a CLOSED TREE
browser/base/content/browser-fullScreen.js
browser/base/content/pageinfo/pageInfo.js
browser/base/content/test/general/browser_bug553455.js
browser/base/content/test/general/browser_bug592338.js
browser/base/content/test/general/browser_devices_get_user_media.js
browser/base/content/test/general/browser_notification_tab_switching.js
browser/base/content/test/general/browser_remoteTroubleshoot.js
browser/base/content/test/general/head.js
browser/base/content/test/plugins/browser_pageInfo_plugins.js
browser/base/content/test/plugins/head.js
browser/base/content/urlbarBindings.xml
browser/components/preferences/aboutPermissions.js
browser/components/preferences/advanced.js
browser/components/preferences/in-content/advanced.js
browser/components/preferences/permissions.js
browser/components/preferences/tests/browser_chunk_permissions.js
browser/components/preferences/tests/browser_cookies_exceptions.js
browser/components/preferences/translation.js
browser/components/translation/test/browser_translation_exceptions.js
browser/components/uitour/test/head.js
browser/modules/SitePermissions.jsm
browser/modules/test/browser_SelfSupportBackend.js
browser/modules/webrtcUI.jsm
extensions/cookie/nsPermissionManager.cpp
extensions/cookie/test/unit/test_permmanager_mailto.js
extensions/cookie/test/unit/test_permmanager_removepermission.js
extensions/cookie/test/unit/xpcshell.ini
mobile/android/chrome/content/PermissionsHelper.js
mobile/android/chrome/content/browser.js
netwerk/base/nsIPermissionManager.idl
toolkit/forgetaboutsite/ForgetAboutSite.jsm
toolkit/modules/tests/xpcshell/test_web_channel.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth2.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth3.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth4.js
toolkit/mozapps/extensions/test/xpinstall/browser_badhash.js
toolkit/mozapps/extensions/test/xpinstall/browser_badhashtype.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug645699.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug672485.js
toolkit/mozapps/extensions/test/xpinstall/browser_cancel.js
toolkit/mozapps/extensions/test/xpinstall/browser_concurrent_installs.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
toolkit/mozapps/extensions/test/xpinstall/browser_corrupt.js
toolkit/mozapps/extensions/test/xpinstall/browser_empty.js
toolkit/mozapps/extensions/test/xpinstall/browser_hash.js
toolkit/mozapps/extensions/test/xpinstall/browser_hash2.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash2.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash3.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash4.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash5.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash6.js
toolkit/mozapps/extensions/test/xpinstall/browser_installchrome.js
toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway.js
toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway2.js
toolkit/mozapps/extensions/test/xpinstall/browser_offline.js
toolkit/mozapps/extensions/test/xpinstall/browser_relative.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_multiple.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_naming.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_tampered.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_trigger.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_untrusted.js
toolkit/mozapps/extensions/test/xpinstall/browser_softwareupdate.js
toolkit/mozapps/extensions/test/xpinstall/browser_switchtab.js
toolkit/mozapps/extensions/test/xpinstall/browser_trigger_redirect.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger_iframe.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist2.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist3.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist4.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist7.js
--- a/browser/base/content/browser-fullScreen.js
+++ b/browser/base/content/browser-fullScreen.js
@@ -350,20 +350,21 @@ var FullScreen = {
         // session only. Add the permission (so Gecko knows to approve any further
         // fullscreen requests for this host in this fullscreen session) but add
         // a listener to revoke the permission when the chrome document exits
         // fullscreen.
         Services.perms.add(uri,
                            "fullscreen",
                            Services.perms.ALLOW_ACTION,
                            Services.perms.EXPIRE_SESSION);
+        let host = uri.host;
         var onFullscreenchange = function onFullscreenchange(event) {
           if (event.target == document && document.mozFullScreenElement == null) {
             // The chrome document has left fullscreen. Remove the temporary permission grant.
-            Services.perms.remove(uri, "fullscreen");
+            Services.perms.remove(host, "fullscreen");
             document.removeEventListener("mozfullscreenchange", onFullscreenchange);
           }
         }
         document.addEventListener("mozfullscreenchange", onFullscreenchange);
       }
     }
     if (this.warningBox)
       this.warningBox.setAttribute("fade-warning-out", "true");
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -857,17 +857,17 @@ function onBlockImage()
   var permissionManager = Components.classes[PERMISSION_CONTRACTID]
                                     .getService(nsIPermissionManager);
 
   var checkbox = document.getElementById("blockImage");
   var uri = makeURI(document.getElementById("imageurltext").value);
   if (checkbox.checked)
     permissionManager.add(uri, "image", nsIPermissionManager.DENY_ACTION);
   else
-    permissionManager.remove(uri, "image");
+    permissionManager.remove(uri.host, "image");
 }
 
 function onImageSelect()
 {
   var previewBox   = document.getElementById("mediaPreviewBox");
   var mediaSaveBox = document.getElementById("mediaSaveBox");
   var splitter     = document.getElementById("mediaSplitter");
   var tree = document.getElementById("imagetree");
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -278,17 +278,17 @@ function test_whitelisted_install() {
         is(notification.getAttribute("label"),
            "XPI Test will be installed after you restart " + gApp + ".",
            "Should have seen the right message");
 
         AddonManager.getAllInstalls(function(aInstalls) {
           is(aInstalls.length, 1, "Should be one pending install");
           aInstalls[0].cancel();
 
-          Services.perms.remove(makeURI("http://example.com/"), "install");
+          Services.perms.remove("example.com", "install");
           wait_for_notification_close(runNextTest);
           gBrowser.removeTab(gBrowser.selectedTab);
         });
       });
 
       accept_install_dialog();
     });
   });
@@ -310,17 +310,17 @@ function test_failed_download() {
   wait_for_progress_notification(function(aPanel) {
     // Wait for the failed notification
     wait_for_notification("addon-install-failed", function(aPanel) {
       let notification = aPanel.childNodes[0];
       is(notification.getAttribute("label"),
          "The add-on could not be downloaded because of a connection failure.",
          "Should have seen the right message");
 
-      Services.perms.remove(makeURI("http://example.com/"), "install");
+      Services.perms.remove("example.com", "install");
       wait_for_notification_close(runNextTest);
       gBrowser.removeTab(gBrowser.selectedTab);
     });
   });
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
@@ -337,17 +337,17 @@ function test_corrupt_file() {
     // Wait for the failed notification
     wait_for_notification("addon-install-failed", function(aPanel) {
       let notification = aPanel.childNodes[0];
       is(notification.getAttribute("label"),
          "The add-on downloaded from this site could not be installed " +
          "because it appears to be corrupt.",
          "Should have seen the right message");
 
-      Services.perms.remove(makeURI("http://example.com/"), "install");
+      Services.perms.remove("example.com", "install");
       wait_for_notification_close(runNextTest);
       gBrowser.removeTab(gBrowser.selectedTab);
     });
   });
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
@@ -364,17 +364,17 @@ function test_incompatible() {
     // Wait for the failed notification
     wait_for_notification("addon-install-failed", function(aPanel) {
       let notification = aPanel.childNodes[0];
       is(notification.getAttribute("label"),
          "XPI Test could not be installed because it is not compatible with " +
          gApp + " " + gVersion + ".",
          "Should have seen the right message");
 
-      Services.perms.remove(makeURI("http://example.com/"), "install");
+      Services.perms.remove("example.com", "install");
       wait_for_notification_close(runNextTest);
       gBrowser.removeTab(gBrowser.selectedTab);
     });
   });
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
@@ -398,17 +398,17 @@ function test_restartless() {
            "Should have seen the right message");
 
         AddonManager.getAllInstalls(function(aInstalls) {
           is(aInstalls.length, 0, "Should be no pending installs");
 
           AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
             aAddon.uninstall();
 
-            Services.perms.remove(makeURI("http://example.com/"), "install");
+            Services.perms.remove("example.com", "install");
             wait_for_notification_close(runNextTest);
             gBrowser.removeTab(gBrowser.selectedTab);
           });
         });
       });
 
       accept_install_dialog();
     });
@@ -439,17 +439,17 @@ function test_multiple() {
 
         AddonManager.getAllInstalls(function(aInstalls) {
           is(aInstalls.length, 1, "Should be one pending install");
           aInstalls[0].cancel();
 
           AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
             aAddon.uninstall();
 
-            Services.perms.remove(makeURI("http://example.com/"), "install");
+            Services.perms.remove("example.com", "install");
             wait_for_notification_close(runNextTest);
             gBrowser.removeTab(gBrowser.selectedTab);
           });
         });
       });
 
       accept_install_dialog();
     });
@@ -511,17 +511,17 @@ function test_sequential() {
             is(PopupNotifications.panel.childNodes.length, 1, "Should be the right number of notifications");
             is(PopupNotifications.panel.childNodes[0].id, "addon-install-confirmation-notification",
                "Should still have an install confirmation open");
 
             // Should have the next add-on's confirmation dialog
             is(container.childNodes.length, 1, "Should be one item listed");
             is(container.childNodes[0].firstChild.getAttribute("value"), "Theme Test", "Should have the right add-on");
 
-            Services.perms.remove(makeURI("http://example.com"), "install");
+            Services.perms.remove("example.com", "install");
             wait_for_notification_close(() => {
               gBrowser.removeTab(gBrowser.selectedTab);
               runNextTest();
             });
 
             cancel_install_dialog();
           });
         }, "addon-install-confirmation", false);
@@ -575,17 +575,17 @@ function test_someunverified() {
         AddonManager.getAddonsByIDs(["restartless-xpi@tests.mozilla.org",
                                      "theme-xpi@tests.mozilla.org"], function([a, t]) {
           a.uninstall();
           // Installing a new theme tries to switch to it, switch back to the
           // default theme.
           t.userDisabled = true;
           t.uninstall();
 
-          Services.perms.remove(makeURI("http://example.com/"), "install");
+          Services.perms.remove("example.com", "install");
           wait_for_notification_close(runNextTest);
           gBrowser.removeTab(gBrowser.selectedTab);
         });
       });
 
       accept_install_dialog();
     });
   });
@@ -623,17 +623,17 @@ function test_allunverified() {
       is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
       is(container.childNodes[0].childNodes.length, 1, "Shouldn't have the unverified marker");
 
       // Wait for the complete notification
       wait_for_notification("addon-install-complete", function(aPanel) {
         AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
           aAddon.uninstall();
 
-          Services.perms.remove(makeURI("http://example.com/"), "install");
+          Services.perms.remove("example.com", "install");
           wait_for_notification_close(runNextTest);
           gBrowser.removeTab(gBrowser.selectedTab);
         });
       });
 
       accept_install_dialog();
     });
   });
@@ -790,17 +790,17 @@ function test_reload() {
           gBrowser.removeEventListener("load", arguments.callee, true);
 
           PopupNotifications.panel.removeEventListener("popuphiding", test_fail, false);
 
           AddonManager.getAllInstalls(function(aInstalls) {
             is(aInstalls.length, 1, "Should be one pending install");
             aInstalls[0].cancel();
 
-            Services.perms.remove(makeURI("http://example.com/"), "install");
+            Services.perms.remove("example.com", "install");
             wait_for_notification_close(runNextTest);
             gBrowser.removeTab(gBrowser.selectedTab);
           });
         }, true);
         gBrowser.loadURI(TESTROOT2 + "enabled.html");
       });
 
       accept_install_dialog();
@@ -834,17 +834,17 @@ function test_theme() {
           ok(aAddon.userDisabled, "Should be switching away from the default theme.");
           // Undo the pending theme switch
           aAddon.userDisabled = false;
 
           AddonManager.getAddonByID("theme-xpi@tests.mozilla.org", function(aAddon) {
             isnot(aAddon, null, "Test theme will have been installed");
             aAddon.uninstall();
 
-            Services.perms.remove(makeURI("http://example.com/"), "install");
+            Services.perms.remove("example.com", "install");
             wait_for_notification_close(runNextTest);
             gBrowser.removeTab(gBrowser.selectedTab);
           });
         });
       });
 
       accept_install_dialog();
     });
@@ -913,17 +913,17 @@ function test_renotify_installed() {
                 info("Timeouts after this probably mean bug 589954 regressed");
 
                 // Wait for the complete notification
                 wait_for_notification("addon-install-restart", function(aPanel) {
                   AddonManager.getAllInstalls(function(aInstalls) {
                   is(aInstalls.length, 1, "Should be one pending installs");
                     aInstalls[0].cancel();
 
-                    Services.perms.remove(makeURI("http://example.com/"), "install");
+                    Services.perms.remove("example.com", "install");
                     wait_for_notification_close(runNextTest);
                     gBrowser.removeTab(gBrowser.selectedTab);
                   });
                 });
 
                 accept_install_dialog();
               });
             });
@@ -981,17 +981,17 @@ function test_cancel() {
         install.removeListener(this);
 
         executeSoon(function() {
           ok(!PopupNotifications.isPanelOpen, "Notification should be closed");
 
           AddonManager.getAllInstalls(function(aInstalls) {
             is(aInstalls.length, 0, "Should be no pending install");
 
-            Services.perms.remove(makeURI("http://example.com/"), "install");
+            Services.perms.remove("example.com", "install");
             gBrowser.removeTab(gBrowser.selectedTab);
             runNextTest();
           });
         });
       }
     });
 
     // Cancel the download
--- a/browser/base/content/test/general/browser_bug592338.js
+++ b/browser/base/content/test/general/browser_bug592338.js
@@ -32,17 +32,17 @@ function test_install_http() {
     executeSoon(function() {
       var link = gBrowser.contentDocument.getElementById("theme-install");
       EventUtils.synthesizeMouse(link, 2, 2, {}, gBrowser.contentWindow);
 
       is(LightweightThemeManager.currentTheme, null, "Should not have installed the test theme");
 
       gBrowser.removeTab(gBrowser.selectedTab);
 
-      pm.remove(makeURI("http://example.org/"), "install");
+      pm.remove("example.org", "install");
 
       runNextTest();
     });
   }, false);
 },
 
 function test_install_lwtheme() {
   is(LightweightThemeManager.currentTheme, null, "Should be no lightweight theme selected");
@@ -61,17 +61,17 @@ function test_install_lwtheme() {
       var link = gBrowser.contentDocument.getElementById("theme-install");
       EventUtils.synthesizeMouse(link, 2, 2, {}, gBrowser.contentWindow);
 
       is(LightweightThemeManager.currentTheme.id, "test", "Should have installed the test theme");
 
       LightweightThemeManager.currentTheme = null;
       gBrowser.removeTab(gBrowser.selectedTab);
 
-      Services.perms.remove(makeURI("http://example.com/"), "install");
+      Services.perms.remove("example.com", "install");
 
       runNextTest();
     });
   }, false);
 },
 
 function test_lwtheme_switch_theme() {
   is(LightweightThemeManager.currentTheme, null, "Should be no lightweight theme selected");
@@ -101,17 +101,17 @@ function test_lwtheme_switch_theme() {
           is(notification.button.label, "Restart Now", "Should have seen the right button");
 
           ok(aAddon.userDisabled, "Should be waiting to disable the test theme");
           aAddon.userDisabled = false;
           Services.prefs.setBoolPref("extensions.dss.enabled", true);
 
           gBrowser.removeTab(gBrowser.selectedTab);
 
-          Services.perms.remove(makeURI("http://example.com"), "install");
+          Services.perms.remove("example.com", "install");
 
           runNextTest();
         });
         EventUtils.synthesizeMouse(link, 2, 2, {}, gBrowser.contentWindow);
       });
     }, false);
   });
 }
--- a/browser/base/content/test/general/browser_devices_get_user_media.js
+++ b/browser/base/content/test/general/browser_devices_get_user_media.js
@@ -562,17 +562,17 @@ let gTests = [
         let uri = content.document.documentURIObject;
         let devicePerms = Perms.testExactPermission(uri, aDevice);
         if (aExpected === undefined)
           is(devicePerms, Perms.UNKNOWN_ACTION, "no " + aDevice + " persistent permissions");
         else {
           is(devicePerms, aExpected ? Perms.ALLOW_ACTION : Perms.DENY_ACTION,
              aDevice + " persistently " + (aExpected ? "allowed" : "denied"));
         }
-        Perms.remove(uri, aDevice);
+        Perms.remove(uri.host, aDevice);
       }
       checkDevicePermissions("microphone", aExpectedAudioPerm);
       checkDevicePermissions("camera", aExpectedVideoPerm);
 
       if (expectedMessage == "ok")
         yield closeStream();
     }
 
@@ -668,18 +668,18 @@ let gTests = [
 
           yield closeStream();
         }
         else {
           expectObserverCalled("recording-window-ended");
         }
       }
 
-      Perms.remove(uri, "camera");
-      Perms.remove(uri, "microphone");
+      Perms.remove(uri.host, "camera");
+      Perms.remove(uri.host, "microphone");
     }
 
     // Set both permissions identically
     info("allow audio+video, request audio+video, expect ok (audio+video)");
     yield usePerm(true, true, true, true, true);
     info("deny audio+video, request audio+video, expect denied");
     yield usePerm(false, false, true, true, false);
 
@@ -789,18 +789,18 @@ let gTests = [
       if (aRequestVideo)
         is(videoPerm, Perms.UNKNOWN_ACTION, "camera permissions removed");
       else
         is(videoPerm, Perms.ALLOW_ACTION, "camera permissions untouched");
 
       // Cleanup.
       yield closeStream(true);
 
-      Perms.remove(uri, "camera");
-      Perms.remove(uri, "microphone");
+      Perms.remove(uri.host, "camera");
+      Perms.remove(uri.host, "microphone");
     }
 
     info("request audio+video, stop sharing resets both");
     yield stopAndCheckPerm(true, true);
     info("request audio, stop sharing resets audio only");
     yield stopAndCheckPerm(true, false);
     info("request video, stop sharing resets video only");
     yield stopAndCheckPerm(false, true);
@@ -883,18 +883,18 @@ let gTests = [
     for (let node of notification.childNodes) {
       if (node.localName == "menuitem")
         labels.push(node.getAttribute("label"));
     }
     is(labels.indexOf(alwaysLabel), -1, "The 'Always Allow' item isn't shown");
 
     // Cleanup.
     yield closeStream(true);
-    Perms.remove(uri, "camera");
-    Perms.remove(uri, "microphone");
+    Perms.remove(uri.host, "camera");
+    Perms.remove(uri.host, "microphone");
   }
 }
 
 ];
 
 function test() {
   waitForExplicitFinish();
 
--- a/browser/base/content/test/general/browser_notification_tab_switching.js
+++ b/browser/base/content/test/general/browser_notification_tab_switching.js
@@ -9,17 +9,17 @@ let notification;
 let notificationURL = "http://example.org/browser/browser/base/content/test/general/file_dom_notifications.html";
 let newWindowOpenedFromTab;
 
 function test () {
   waitForExplicitFinish();
 
   let pm = Services.perms;
   registerCleanupFunction(function() {
-    pm.remove(makeURI(notificationURL), "desktop-notification");
+    pm.remove(notificationURL, "desktop-notification");
     gBrowser.removeTab(tab);
     window.restore();
   });
 
   pm.add(makeURI(notificationURL), "desktop-notification", pm.ALLOW_ACTION);
 
   tab = gBrowser.addTab(notificationURL);
   tab.linkedBrowser.addEventListener("load", onLoad, true);
--- a/browser/base/content/test/general/browser_remoteTroubleshoot.js
+++ b/browser/base/content/test/general/browser_remoteTroubleshoot.js
@@ -39,17 +39,17 @@ add_task(function*() {
   // Should have no data.
   Assert.ok(got.message === undefined, "should have failed to get any data");
 
   // Add a permission manager entry for our URI.
   Services.perms.add(TEST_URI_GOOD,
                      "remote-troubleshooting",
                      Services.perms.ALLOW_ACTION);
   registerCleanupFunction(() => {
-    Services.perms.remove(TEST_URI_GOOD, "remote-troubleshooting");
+    Services.perms.remove(TEST_URI_GOOD.spec, "remote-troubleshooting");
   });
 
   // Try again - now we are expecting a response with the actual data.
   got = yield promiseNewChannelResponse(TEST_URI_GOOD);
 
   // Check some keys we expect to always get.
   Assert.ok(got.message.extensions, "should have extensions");
   Assert.ok(got.message.graphics, "should have graphics");
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -172,17 +172,17 @@ function clearAllPluginPermissions() {
   clearAllPermissionsByPrefix("plugin");
 }
 
 function clearAllPermissionsByPrefix(aPrefix) {
   let perms = Services.perms.enumerator;
   while (perms.hasMoreElements()) {
     let perm = perms.getNext();
     if (perm.type.startsWith(aPrefix)) {
-      Services.perms.removePermission(perm);
+      Services.perms.remove(perm.host, perm.type);
     }
   }
 }
 
 function pushPrefs(...aPrefs) {
   let deferred = Promise.defer();
   SpecialPowers.pushPrefEnv({"set": aPrefs}, deferred.resolve);
   return deferred.promise;
--- a/browser/base/content/test/plugins/browser_pageInfo_plugins.js
+++ b/browser/base/content/test/plugins/browser_pageInfo_plugins.js
@@ -33,18 +33,18 @@ function doOnOpenPageInfo(continuation) 
 }
 
 function pageInfoObserve(win, topic, data) {
   Services.obs.removeObserver(pageInfoObserve, "page-info-dialog-loaded");
   executeSoon(gNextTest);
 }
 
 function finishTest() {
-  gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gTestPermissionString);
-  gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gSecondTestPermissionString);
+  gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
+  gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
   Services.prefs.clearUserPref("plugins.click_to_play");
   gBrowser.removeCurrentTab();
 
   gPageInfo = null;
   gNextTest = null;
   gTestBrowser = null;
   gPluginHost = null;
   gPermissionManager = null;
@@ -54,18 +54,18 @@ function finishTest() {
 
 function test() {
   waitForExplicitFinish();
   Services.prefs.setBoolPref("plugins.click_to_play", true);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY);
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
   gBrowser.selectedTab = gBrowser.addTab();
   gTestBrowser = gBrowser.selectedBrowser;
-  gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gTestPermissionString);
-  gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gSecondTestPermissionString);
+  gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
+  gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
   doOnPageLoad(gHttpTestRoot + "plugin_two_types.html", testPart1a);
 }
 
 // The first test plugin is CtP and the second test plugin is enabled.
 function testPart1a() {
   let test = gTestBrowser.contentDocument.getElementById("test");
   let objLoadingContent = test.QueryInterface(Ci.nsIObjectLoadingContent);
   ok(!objLoadingContent.activated, "part 1a: Test plugin should not be activated");
@@ -136,18 +136,18 @@ function testPart3() {
   let secondtest = gTestBrowser.contentDocument.getElementById("secondtestA").
     QueryInterface(Ci.nsIObjectLoadingContent);
 
   ok(!secondtest.activated, "part 3: Second Test plugin should not be activated");
   is(secondtest.pluginFallbackType, Ci.nsIObjectLoadingContent.PLUGIN_DISABLED,
      "part 3: Second test plugin should be marked as PLUGIN_DISABLED");
 
   // reset permissions
-  gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gTestPermissionString);
-  gPermissionManager.remove(makeURI("http://127.0.0.1:8888/"), gSecondTestPermissionString);
+  gPermissionManager.remove("127.0.0.1:8888", gTestPermissionString);
+  gPermissionManager.remove("127.0.0.1:8888", gSecondTestPermissionString);
   // check that changing the permissions affects the radio state in the
   // open Page Info window
   let testRadioGroup = gPageInfo.document.getElementById(gTestPermissionString + "RadioGroup");
   let testRadioDefault = gPageInfo.document.getElementById(gTestPermissionString + "#0");
   is(testRadioGroup.selectedItem, testRadioDefault, "part 3: Test radio group should be set to 'Default'");
   let secondtestRadioGroup = gPageInfo.document.getElementById(gSecondTestPermissionString + "RadioGroup");
   let secondtestRadioDefault = gPageInfo.document.getElementById(gSecondTestPermissionString + "#0");
   is(secondtestRadioGroup.selectedItem, secondtestRadioDefault, "part 3: Second Test radio group should be set to 'Default'");
--- a/browser/base/content/test/plugins/head.js
+++ b/browser/base/content/test/plugins/head.js
@@ -234,17 +234,17 @@ function promiseReloadPlugin(aId, aBrows
 // after a test is done using the plugin doorhanger, we should just clear
 // any permissions that may have crept in
 function clearAllPluginPermissions() {
   let perms = Services.perms.enumerator;
   while (perms.hasMoreElements()) {
     let perm = perms.getNext();
     if (perm.type.startsWith('plugin')) {
       info("removing permission:" + perm.host + " " + perm.type + "\n");
-      Services.perms.removePermission(perm);
+      Services.perms.remove(perm.host, perm.type);
     }
   }
 }
 
 function updateBlocklist(aCallback) {
   let blocklistNotifier = Cc["@mozilla.org/extensions/blocklist;1"]
                           .getService(Ci.nsITimerCallback);
   let observer = function() {
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -2414,17 +2414,17 @@ file, You can obtain one at http://mozil
           BrowserReload();
         ]]></body>
       </method>
       <method name="enableTrackingContentProtection">
         <body><![CDATA[
           // Remove the current host from the 'trackingprotection' consumer
           // of the permission manager. This effectively removes this host
           // from the tracking protection allowlist.
-          Services.perms.remove(gBrowser.selectedBrowser.currentURI,
+          Services.perms.remove(gBrowser.selectedBrowser.currentURI.host,
             "trackingprotection");
           BrowserReload();
         ]]></body>
       </method>
     </implementation>
   </binding>
 
   <binding id="click-to-play-plugins-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
--- a/browser/components/preferences/aboutPermissions.js
+++ b/browser/components/preferences/aboutPermissions.js
@@ -174,17 +174,17 @@ Site.prototype = {
   /**
    * Clears a user-set permission value for the site given a permission type.
    *
    * @param aType
    *        The permission type string stored in permission manager.
    *        e.g. "cookie", "geo", "indexedDB", "popup", "image"
    */
   clearPermission: function Site_clearPermission(aType) {
-    Services.perms.remove(this.httpURI, aType);
+    Services.perms.remove(this.host, aType);
   },
 
   /**
    * Gets cookies stored for the site. This does not return cookies stored
    * for the base domain, only the exact hostname stored for the site.
    *
    * @return An array of the cookies set for the site.
    */
--- a/browser/components/preferences/advanced.js
+++ b/browser/components/preferences/advanced.js
@@ -453,30 +453,30 @@ var gAdvancedPane = {
                    windowTitle      : bundlePreferences.getString("offlinepermissionstitle"),
                    introText        : bundlePreferences.getString("offlinepermissionstext") };
     document.documentElement.openWindow("Browser:Permissions",
                                         "chrome://browser/content/preferences/permissions.xul",
                                         "resizable", params);
   },
 
   // XXX: duplicated in browser.js
-  _getOfflineAppUsage: function (perm, groups)
+  _getOfflineAppUsage: function (host, groups)
   {
     var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                        getService(Components.interfaces.nsIApplicationCacheService);
     if (!groups)
       groups = cacheService.getGroups();
 
     var ios = Components.classes["@mozilla.org/network/io-service;1"].
               getService(Components.interfaces.nsIIOService);
 
     var usage = 0;
     for (var i = 0; i < groups.length; i++) {
       var uri = ios.newURI(groups[i], null, null);
-      if (uri.asciiHost == perm.host) {
+      if (uri.asciiHost == host) {
         var cache = cacheService.getActiveCache(groups[i]);
         usage += cache.usage;
       }
     }
 
     return usage;
   },
 
@@ -505,17 +505,17 @@ var gAdvancedPane = {
       if (perm.type == "offline-app" &&
           perm.capability != Components.interfaces.nsIPermissionManager.DEFAULT_ACTION &&
           perm.capability != Components.interfaces.nsIPermissionManager.DENY_ACTION) {
         var row = document.createElement("listitem");
         row.id = "";
         row.className = "offlineapp";
         row.setAttribute("host", perm.host);
         var converted = DownloadUtils.
-                        convertByteUnits(this._getOfflineAppUsage(perm, groups));
+                        convertByteUnits(this._getOfflineAppUsage(perm.host, groups));
         row.setAttribute("usage",
                          bundle.getFormattedString("offlineAppUsage",
                                                    converted));
         list.appendChild(row);
       }
     }
   },
 
@@ -552,35 +552,30 @@ var gAdvancedPane = {
 
     // clear offline cache entries
     var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                        getService(Components.interfaces.nsIApplicationCacheService);
     var ios = Components.classes["@mozilla.org/network/io-service;1"].
               getService(Components.interfaces.nsIIOService);
     var groups = cacheService.getGroups();
     for (var i = 0; i < groups.length; i++) {
-        let uri = ios.newURI(groups[i], null, null);
+        var uri = ios.newURI(groups[i], null, null);
         if (uri.asciiHost == host) {
             var cache = cacheService.getActiveCache(groups[i]);
             cache.discard();
         }
     }
 
     // remove the permission
     var pm = Components.classes["@mozilla.org/permissionmanager;1"]
                        .getService(Components.interfaces.nsIPermissionManager);
-    let uri;
-    try {
-      // file:// URIs are stored with their scheme. We try to parse them first, as
-      // URIs like http://file:///foo/bar/baz.html will parse as HTTP URIs.
-      uri = ios.newURI(host, null, null);
-    } catch (e) {
-      uri = ios.newURI("http://" + host, null, null);
-    }
-    pm.remove(uri, "offline-app");
+    pm.remove(host, "offline-app",
+              Components.interfaces.nsIPermissionManager.ALLOW_ACTION);
+    pm.remove(host, "offline-app",
+              Components.interfaces.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
 
     list.removeChild(item);
     gAdvancedPane.offlineAppSelected();
     this.updateActualAppCacheSize();
   },
 
   // UPDATE TAB
 
--- a/browser/components/preferences/in-content/advanced.js
+++ b/browser/components/preferences/in-content/advanced.js
@@ -487,27 +487,27 @@ var gAdvancedPane = {
                    introText        : bundlePreferences.getString("offlinepermissionstext") };
     openDialog("chrome://browser/content/preferences/permissions.xul",
                "Browser:Permissions",
                "modal=yes",
                params);
   },
 
   // XXX: duplicated in browser.js
-  _getOfflineAppUsage: function (perm, groups)
+  _getOfflineAppUsage: function (host, groups)
   {
     var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                        getService(Components.interfaces.nsIApplicationCacheService);
     var ios = Components.classes["@mozilla.org/network/io-service;1"].
               getService(Components.interfaces.nsIIOService);
 
     var usage = 0;
     for (var i = 0; i < groups.length; i++) {
       var uri = ios.newURI(groups[i], null, null);
-      if (uri.asciiHost == perm.host) {
+      if (uri.asciiHost == host) {
         var cache = cacheService.getActiveCache(groups[i]);
         usage += cache.usage;
       }
     }
 
     return usage;
   },
 
@@ -541,17 +541,17 @@ var gAdvancedPane = {
       if (perm.type == "offline-app" &&
           perm.capability != Components.interfaces.nsIPermissionManager.DEFAULT_ACTION &&
           perm.capability != Components.interfaces.nsIPermissionManager.DENY_ACTION) {
         var row = document.createElement("listitem");
         row.id = "";
         row.className = "offlineapp";
         row.setAttribute("host", perm.host);
         var converted = DownloadUtils.
-                        convertByteUnits(this._getOfflineAppUsage(perm, groups));
+                        convertByteUnits(this._getOfflineAppUsage(perm.host, groups));
         row.setAttribute("usage",
                          bundle.getFormattedString("offlineAppUsage",
                                                    converted));
         list.appendChild(row);
       }
     }
   },
 
@@ -589,36 +589,31 @@ var gAdvancedPane = {
     // clear offline cache entries
     try {
       var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"].
                          getService(Components.interfaces.nsIApplicationCacheService);
       var ios = Components.classes["@mozilla.org/network/io-service;1"].
                 getService(Components.interfaces.nsIIOService);
       var groups = cacheService.getGroups();
       for (var i = 0; i < groups.length; i++) {
-          let uri = ios.newURI(groups[i], null, null);
+          var uri = ios.newURI(groups[i], null, null);
           if (uri.asciiHost == host) {
               var cache = cacheService.getActiveCache(groups[i]);
               cache.discard();
           }
       }
     } catch (e) {}
 
     // remove the permission
     var pm = Components.classes["@mozilla.org/permissionmanager;1"]
                        .getService(Components.interfaces.nsIPermissionManager);
-    let uri;
-    try {
-      // file:// URIs are stored with their scheme. We try to parse them first, as
-      // URIs like http://file:///foo/bar/baz.html will parse as HTTP URIs.
-      uri = ios.newURI(host, null, null);
-    } catch (e) {
-      uri = ios.newURI("http://" + host, null, null);
-    }
-    pm.remove(uri, "offline-app");
+    pm.remove(host, "offline-app",
+              Components.interfaces.nsIPermissionManager.ALLOW_ACTION);
+    pm.remove(host, "offline-app",
+              Components.interfaces.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
 
     list.removeChild(item);
     gAdvancedPane.offlineAppSelected();
     this.updateActualAppCacheSize();
   },
 
   // UPDATE TAB
 
--- a/browser/components/preferences/permissions.js
+++ b/browser/components/preferences/permissions.js
@@ -363,18 +363,17 @@ var gPermissionManager = {
     this.uninit();
 
     for (let permissionParams of this._permissionsToAdd.values()) {
       let uri = Services.io.newURI("http://" + permissionParams.host, null, null);
       Services.perms.add(uri, permissionParams.type, permissionParams.capability);
     }
 
     for (let p of this._permissionsToDelete.values()) {
-      let uri = Services.io.newURI("http://" + p.host, null, null);
-      Services.perms.remove(uri, p.type);
+      Services.perms.remove(p.host, p.type);
     }
 
     window.close();
   },
 
   _loadPermissions: function ()
   {
     this._tree = document.getElementById("permissionsTree");
--- a/browser/components/preferences/tests/browser_chunk_permissions.js
+++ b/browser/components/preferences/tests/browser_chunk_permissions.js
@@ -49,19 +49,19 @@ function setup(aCallback) {
     Services.perms.add(TEST_URI_3, "popup", TEST_PERMS["popup"]);
     aCallback();
   });
 }
 
 function cleanUp() {
   for (let type in TEST_PERMS) {
     if (type != "password") {
-      Services.perms.remove(TEST_URI_1, type);
-      Services.perms.remove(TEST_URI_2, type);
-      Services.perms.remove(TEST_URI_3, type);
+      Services.perms.remove(TEST_URI_1.host, type);
+      Services.perms.remove(TEST_URI_2.host, type);
+      Services.perms.remove(TEST_URI_3.host, type);
     }
   }
 }
 
 function runNextTest() {
   if (gTestIndex == tests.length) {
     PlacesTestUtils.clearHistory().then(finish);
     return;
--- a/browser/components/preferences/tests/browser_cookies_exceptions.js
+++ b/browser/components/preferences/tests/browser_cookies_exceptions.js
@@ -59,18 +59,17 @@ var testRunner = {
           let uri = params.ioService.newURI("http://test.com", null, null);
           params.pm.add(uri, "popup", Ci.nsIPermissionManager.DENY_ACTION);
           is(params.tree.view.rowCount, 0, "adding unrelated permission should not change display");
           params.btnApplyChanges.doCommand();
         },
         observances: [{ type: "popup", host: "test.com", data: "added",
                         capability: Ci.nsIPermissionManager.DENY_ACTION }],
         cleanUp: function(params) {
-          let uri = params.ioService.newURI("http://test.com", null, null);
-          params.pm.remove(uri, "popup");
+          params.pm.remove("test.com", "popup");
         },
       },
     ],
 
   _currentTest: -1,
 
   runTests: function() {
     this._currentTest++;
--- a/browser/components/preferences/translation.js
+++ b/browser/components/preferences/translation.js
@@ -183,33 +183,29 @@ let gTranslationExceptions = {
   },
 
   onAllLanguagesDeleted: function() {
     Services.prefs.setCharPref(kLanguagesPref, "");
   },
 
   onSiteDeleted: function() {
     let removedSites = this._siteTree.getSelectedItems();
-    for (let host of removedSites) {
-      let uri = Services.io.newURI("http://" + host, null, null);
-      Services.perms.remove(uri, kPermissionType);
-    }
+    for (let host of removedSites)
+      Services.perms.remove(host, kPermissionType);
   },
 
   onAllSitesDeleted: function() {
     if (this._siteTree.isEmpty)
       return;
 
     let removedSites = this._sites.splice(0, this._sites.length);
     this._siteTree.boxObject.rowCountChanged(0, -removedSites.length);
 
-    for (let host of removedSites) {
-      let uri = Services.io.newURI("http://" + host, null, null);
-      Services.perms.remove(uri, kPermissionType);
-    }
+    for (let host of removedSites)
+      Services.perms.remove(host, kPermissionType);
 
     this.onSiteSelected();
   },
 
   onSiteKeyPress: function(aEvent) {
     if (aEvent.keyCode == KeyEvent.DOM_VK_DELETE)
       this.onSiteDeleted();
   },
--- a/browser/components/translation/test/browser_translation_exceptions.js
+++ b/browser/components/translation/test/browser_translation_exceptions.js
@@ -189,17 +189,17 @@ let gTests = [
     PopupNotifications.getNotification("translate").anchorElement.click();
     notif = getInfoBar();
     // Open the "options" drop down.
     yield openPopup(notif._getAnonElt("options"));
     ok(notif._getAnonElt("neverForSite").disabled,
        "The 'Never translate French' item is disabled");
 
     // Cleanup.
-    Services.perms.remove(makeURI("http://example.com"), "translate");
+    Services.perms.remove("example.com", "translate");
     notif.close();
   }
 },
 
 {
   desc: "language exception list",
   run: function* checkLanguageExceptions() {
     // Put 2 languages in the pref before opening the window to check
@@ -282,18 +282,18 @@ let gTests = [
     ok(!remove.disabled, "The 'Remove Site' button is enabled");
 
     // Click the 'Remove' button.
     remove.click();
     is(tree.view.rowCount, 1, "The site exceptions now contains 1 item");
     is(getDomainExceptions().length, 1, "One exception in the permissions");
 
     // Clear the permissions, and check the last item is removed from the display.
-    perms.remove(makeURI("http://example.org"), "translate");
-    perms.remove(makeURI("http://example.com"), "translate");
+    perms.remove("example.org", "translate");
+    perms.remove("example.com", "translate");
     is(tree.view.rowCount, 0, "The site exceptions list is empty");
     ok(remove.disabled, "The 'Remove Site' button is disabled");
     ok(removeAll.disabled, "The 'Remove All Site' button is disabled");
 
     // Add an item and check it appears.
     perms.add(makeURI("http://example.com"), "translate", perms.DENY_ACTION);
     is(tree.view.rowCount, 1, "The site exceptions list has 1 item");
     ok(remove.disabled, "The 'Remove Site' button is disabled");
--- a/browser/components/uitour/test/head.js
+++ b/browser/components/uitour/test/head.js
@@ -207,17 +207,17 @@ function UITourTest() {
     delete window.UITour;
     delete window.UITourMetricsProvider;
     delete window.gContentWindow;
     delete window.gContentAPI;
     if (gTestTab)
       gBrowser.removeTab(gTestTab);
     delete window.gTestTab;
     Services.prefs.clearUserPref("browser.uitour.enabled", true);
-    Services.perms.remove(testUri, "uitour");
+    Services.perms.remove("example.com", "uitour");
   });
 
   function done() {
     executeSoon(() => {
       if (gTestTab)
         gBrowser.removeTab(gTestTab);
       gTestTab = null;
 
--- a/browser/modules/SitePermissions.jsm
+++ b/browser/modules/SitePermissions.jsm
@@ -88,17 +88,17 @@ this.SitePermissions = {
   },
 
   /* Removes the saved state of a particular permission for a given URI.
    */
   remove: function (aURI, aPermissionID) {
     if (!this.isSupportedURI(aURI))
       return;
 
-    Services.perms.remove(aURI, aPermissionID);
+    Services.perms.remove(aURI.host, aPermissionID);
   },
 
   /* Returns the localized label for the permission with the given ID, to be
    * used in a UI for managing permissions.
    */
   getPermissionLabel: function (aPermissionID) {
     return gStringBundle.GetStringFromName("permission." + aPermissionID + ".label");
   },
--- a/browser/modules/test/browser_SelfSupportBackend.js
+++ b/browser/modules/test/browser_SelfSupportBackend.js
@@ -107,17 +107,17 @@ add_task(function* setupEnvironment() {
   Preferences.set(PREF_UITOUR_ENABLED, true);
   Preferences.set(PREF_SELFSUPPORT_URL, TEST_PAGE_URL_HTTPS);
 
   // Whitelist the HTTPS page to use UITour.
   let pageURI = Services.io.newURI(TEST_PAGE_URL_HTTPS, null, null);
   Services.perms.add(pageURI, "uitour", Services.perms.ALLOW_ACTION);
 
   registerCleanupFunction(() => {
-    Services.perms.remove(pageURI, "uitour");
+    Services.perms.remove("example.com", "uitour");
     Preferences.set(PREF_SELFSUPPORT_ENABLED, selfSupportEnabled);
     Preferences.set(PREF_UITOUR_ENABLED, uitourEnabled);
     Preferences.set(PREF_SELFSUPPORT_URL, selfSupportURL);
   });
 });
 
 /**
  * Test that the self support page can use the UITour API and close itself.
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -744,23 +744,24 @@ function updateBrowserSpecificIndicator(
     callback: function () {},
     dismiss: true
   };
   let secondaryActions = [{
     label: stringBundle.getString("getUserMedia.stopSharing.label"),
     accessKey: stringBundle.getString("getUserMedia.stopSharing.accesskey"),
     callback: function () {
       let uri = Services.io.newURI(aState.documentURI, null, null);
+      let host = getHost(uri);
       let perms = Services.perms;
       if (aState.camera &&
           perms.testExactPermission(uri, "camera") == perms.ALLOW_ACTION)
-        perms.remove(uri, "camera");
+        perms.remove(host, "camera");
       if (aState.microphone &&
           perms.testExactPermission(uri, "microphone") == perms.ALLOW_ACTION)
-        perms.remove(uri, "microphone");
+        perms.remove(host, "microphone");
 
       let mm = notification.browser.messageManager;
       mm.sendAsyncMessage("webrtc:StopSharing", windowId);
     }
   }];
   let options = {
     hideNotNow: true,
     dismissed: true,
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -1047,23 +1047,21 @@ nsPermissionManager::AddInternal(nsIPrin
     }
     break;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsPermissionManager::Remove(nsIURI*     aURI,
-                            const char* aType)
+nsPermissionManager::Remove(const nsACString &aHost,
+                            const char       *aType)
 {
-  NS_ENSURE_ARG_POINTER(aURI);
-
   nsCOMPtr<nsIPrincipal> principal;
-  nsresult rv = GetPrincipal(aURI, getter_AddRefs(principal));
+  nsresult rv = GetPrincipal(aHost, getter_AddRefs(principal));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return RemoveFromPrincipal(principal, aType);
 }
 
 NS_IMETHODIMP
 nsPermissionManager::RemoveFromPrincipal(nsIPrincipal* aPrincipal,
                                          const char* aType)
@@ -1090,36 +1088,16 @@ nsPermissionManager::RemoveFromPrincipal
                      nsIPermissionManager::EXPIRE_NEVER,
                      0,
                      0,
                      eNotify,
                      eWriteToDB);
 }
 
 NS_IMETHODIMP
-nsPermissionManager::RemovePermission(nsIPermission* aPerm)
-{
-  nsAutoCString host;
-  nsresult rv = aPerm->GetHost(host);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIPrincipal> principal;
-  rv = GetPrincipal(host, getter_AddRefs(principal));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsAutoCString type;
-  rv = aPerm->GetType(type);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Permissions are uniquely identified by their principal and type.
-  // We remove the permission using these two pieces of data.
-  return RemoveFromPrincipal(principal, type.get());
-}
-
-NS_IMETHODIMP
 nsPermissionManager::RemoveAll()
 {
   ENSURE_NOT_CHILD_PROCESS;
   return RemoveAllInternal(true);
 }
 
 NS_IMETHODIMP
 nsPermissionManager::RemoveAllSince(int64_t aSince)
--- a/extensions/cookie/test/unit/test_permmanager_mailto.js
+++ b/extensions/cookie/test/unit/test_permmanager_mailto.js
@@ -11,24 +11,24 @@ function run_test() {
   let uri = Services.io.newURI("mailto:" + kTestAddr + "?subject=test", null,
                                null);
 
   // add a permission entry for that URI
   Services.perms.add(uri, kType, kCapability);
   do_check_true(permission_exists(kTestAddr, kType, kCapability));
 
   // remove the permission, and make sure it was removed
-  Services.perms.remove(uri, kType);
+  Services.perms.remove(kTestAddr, kType);
   do_check_false(permission_exists(kTestAddr, kType, kCapability));
 
   uri = Services.io.newURI("mailto:" + kTestAddr, null, null);
   Services.perms.add(uri, kType, kCapability);
   do_check_true(permission_exists(kTestAddr, kType, kCapability));
 
-  Services.perms.remove(uri, kType);
+  Services.perms.remove(kTestAddr, kType);
   do_check_false(permission_exists(kTestAddr, kType, kCapability));
 }
 
 function permission_exists(aHost, aType, aCapability) {
   let e = Services.perms.enumerator;
   while (e.hasMoreElements()) {
     let perm = e.getNext().QueryInterface(Ci.nsIPermission);
     if (perm.host == aHost &&
deleted file mode 100644
--- a/extensions/cookie/test/unit/test_permmanager_removepermission.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test() {
-  // initialize the permission manager service
-  let pm = Cc["@mozilla.org/permissionmanager;1"].
-        getService(Ci.nsIPermissionManager);
-
-  do_check_eq(perm_count(), 0);
-
-  // add some permissions
-  let uri = NetUtil.newURI("http://amazon.com:8080/foobarbaz", null, null);
-  let uri2 = NetUtil.newURI("http://google.com:2048/quxx", null, null);
-
-  pm.add(uri, "apple", 0);
-  pm.add(uri, "apple", 3);
-  pm.add(uri, "pear", 3);
-  pm.add(uri, "pear", 1);
-  pm.add(uri, "cucumber", 1);
-  pm.add(uri, "cucumber", 1);
-  pm.add(uri, "cucumber", 1);
-
-  pm.add(uri2, "apple", 2);
-  pm.add(uri2, "pear", 0);
-  pm.add(uri2, "pear", 2);
-
-  // Make sure that removePermission doesn't remove more than one permission each time
-  do_check_eq(perm_count(), 5);
-
-  remove_one_by_type("apple");
-  do_check_eq(perm_count(), 4);
-
-  remove_one_by_type("apple");
-  do_check_eq(perm_count(), 3);
-
-  remove_one_by_type("pear");
-  do_check_eq(perm_count(), 2);
-
-  remove_one_by_type("cucumber");
-  do_check_eq(perm_count(), 1);
-
-  remove_one_by_type("pear");
-  do_check_eq(perm_count(), 0);
-
-
-  function perm_count() {
-    let enumerator = pm.enumerator;
-    let count = 0;
-    while (enumerator.hasMoreElements()) {
-      count++;
-      enumerator.getNext();
-    }
-
-    return count;
-  }
-
-  function remove_one_by_type(type) {
-    let enumerator = pm.enumerator;
-    while (enumerator.hasMoreElements()) {
-      let it = enumerator.getNext().QueryInterface(Ci.nsIPermission);
-      if (it.type == type) {
-        pm.removePermission(it);
-        break;
-      }
-    }
-  }
-}
--- a/extensions/cookie/test/unit/xpcshell.ini
+++ b/extensions/cookie/test/unit/xpcshell.ini
@@ -29,9 +29,8 @@ support-files =
 skip-if = debug == true
 [test_permmanager_idn.js]
 [test_permmanager_subdomains.js]
 [test_permmanager_local_files.js]
 [test_permmanager_mailto.js]
 [test_permmanager_cleardata.js]
 [test_schema_2_migration.js]
 [test_schema_3_migration.js]
-[test_permmanager_removepermission.js]
--- a/mobile/android/chrome/content/PermissionsHelper.js
+++ b/mobile/android/chrome/content/PermissionsHelper.js
@@ -174,16 +174,16 @@ var PermissionsHelper = {
       // Get rid of exisiting stored logings
       let logins = Services.logins.findLogins({}, aURI.prePath, "", "");
       for (let i = 0; i < logins.length; i++) {
         Services.logins.removeLogin(logins[i]);
       }
       // Re-set login saving to enabled
       Services.logins.setLoginSavingEnabled(aURI.prePath, true);
     } else {
-      Services.perms.remove(aURI, aType);
+      Services.perms.remove(aURI.host, aType);
       // Clear content prefs set in ContentPermissionPrompt.js
       Cc["@mozilla.org/content-pref/service;1"]
         .getService(Ci.nsIContentPrefService2)
         .removeByDomainAndName(aURI.spec, aType + ".request.remember", aContext);
     }
   }
 };
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1764,17 +1764,17 @@ var BrowserApp = {
               // the permission manager using a normalized URI. This effectively
               // places this host on the tracking protection white list.
               Services.perms.add(normalizedUrl, "trackingprotection", Services.perms.ALLOW_ACTION);
               Telemetry.addData("TRACKING_PROTECTION_EVENTS", 1);
             } else {
               // Remove the current host from the 'trackingprotection' consumer
               // of the permission manager. This effectively removes this host
               // from the tracking protection white list (any list actually).
-              Services.perms.remove(browser.currentURI, "trackingprotection");
+              Services.perms.remove(browser.currentURI.host, "trackingprotection");
               Telemetry.addData("TRACKING_PROTECTION_EVENTS", 2);
             }
           }
         }
 
         // Try to use the session history to reload so that framesets are
         // handled properly. If the window has no session history, fall back
         // to using the web navigation's reload method.
--- a/netwerk/base/nsIPermissionManager.idl
+++ b/netwerk/base/nsIPermissionManager.idl
@@ -32,17 +32,17 @@
 
 interface nsIURI;
 interface nsIObserver;
 interface nsIPrincipal;
 interface nsIDOMWindow;
 interface nsIPermission;
 interface nsISimpleEnumerator;
 
-[scriptable, uuid(0d1b8c65-0359-4a8c-b94d-4d3643b23e61)]
+[scriptable, uuid(93a156f8-bcc8-4568-a214-389b073332dd)]
 interface nsIPermissionManager : nsISupports
 {
   /**
    * Predefined return values for the testPermission method and for
    * the permission param of the add method
    * NOTE: UNKNOWN_ACTION (0) is reserved to represent the
    * default permission when no entry is found for a host, and
    * should not be used by consumers to indicate otherwise.
@@ -101,44 +101,38 @@ interface nsIPermissionManager : nsISupp
    * granted permissions.
    */
   void addFromPrincipal(in nsIPrincipal principal, in string typed,
                         in uint32_t permission,
                         [optional] in uint32_t expireType,
                         [optional] in int64_t expireTime);
 
   /**
-   * Remove permission information for a given URI and permission type. This will
-   * remove the permission for the entire host described by the uri, acting as the
-   * opposite operation to the add() method.
+   * Remove permission information for a given host string and permission type.
+   * The host string represents the exact entry in the permission list (such as
+   * obtained from the enumerator), not a URI which that permission might apply
+   * to.
    *
-   * @param uri    the uri to remove the permission for
+   * @param host   the host to remove the permission for
    * @param type   a case-sensitive ASCII string, identifying the consumer. 
    *               The type must have been previously registered using the
    *               add() method.
    */
-  void remove(in nsIURI uri,
+  void remove(in AUTF8String host,
               in string type);
 
   /**
    * Remove permission information for a given principal.
    * This is internally calling remove() with the host from the principal's URI.
    * Passing system principal will be a no-op because we never add them to the
    * database.
    */
   void removeFromPrincipal(in nsIPrincipal principal, in string type);
 
   /**
-   * Remove the given permission from the permission manager.
-   *
-   * @param perm   a permission obtained from the permission manager.
-   */
-  void removePermission(in nsIPermission perm);
-
-  /**
    * Clear permission information for all websites.
    */
   void removeAll();
 
   /**
    * Clear all permission information added since the specified time.
    */
   void removeAllSince(in int64_t since);
--- a/toolkit/forgetaboutsite/ForgetAboutSite.jsm
+++ b/toolkit/forgetaboutsite/ForgetAboutSite.jsm
@@ -128,17 +128,17 @@ this.ForgetAboutSite = {
     // Permissions
     let pm = Cc["@mozilla.org/permissionmanager;1"].
              getService(Ci.nsIPermissionManager);
     // Enumerate all of the permissions, and if one matches, remove it
     enumerator = pm.enumerator;
     while (enumerator.hasMoreElements()) {
       let perm = enumerator.getNext().QueryInterface(Ci.nsIPermission);
       if (hasRootDomain(perm.host, aDomain))
-        pm.removePermission(perm);
+        pm.remove(perm.host, perm.type);
     }
 
     // Offline Storages
     let qm = Cc["@mozilla.org/dom/quota/manager;1"].
              getService(Ci.nsIQuotaManager);
     // delete data from both HTTP and HTTPS sites
     let caUtils = {};
     let scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
--- a/toolkit/modules/tests/xpcshell/test_web_channel.js
+++ b/toolkit/modules/tests/xpcshell/test_web_channel.js
@@ -80,17 +80,17 @@ add_task(function test_web_channel_liste
 
 /**
  * Test channel listening with originOrPermission being a permission string.
  */
 add_task(function test_web_channel_listen_permission() {
   return new Promise((resolve, reject) => {
     // add a new permission
     Services.perms.add(VALID_WEB_CHANNEL_ORIGIN, TEST_PERMISSION_NAME, Services.perms.ALLOW_ACTION);
-    do_register_cleanup(() => Services.perms.remove(VALID_WEB_CHANNEL_ORIGIN, TEST_PERMISSION_NAME));
+    do_register_cleanup(() => Services.perms.remove(VALID_WEB_CHANNEL_ORIGIN.spec, TEST_PERMISSION_NAME));
     let channel = new WebChannel(VALID_WEB_CHANNEL_ID, TEST_PERMISSION_NAME, {
       broker: MockWebChannelBroker
     });
     let delivered = 0;
     do_check_eq(channel.id, VALID_WEB_CHANNEL_ID);
     do_check_eq(channel._originOrPermission, TEST_PERMISSION_NAME);
     do_check_eq(channel._deliverCallback, null);
 
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_auth.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_auth.js
@@ -35,13 +35,13 @@ function install_ended(install, addon) {
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
   var authMgr = Components.classes['@mozilla.org/network/http-auth-manager;1']
                           .getService(Components.interfaces.nsIHttpAuthManager);
   authMgr.clearAll();
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_auth2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_auth2.js
@@ -34,13 +34,13 @@ function install_ended(install, addon) {
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
   var authMgr = Components.classes['@mozilla.org/network/http-auth-manager;1']
                           .getService(Components.interfaces.nsIHttpAuthManager);
   authMgr.clearAll();
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_auth3.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_auth3.js
@@ -42,13 +42,13 @@ function install_ended(install, addon) {
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
   var authMgr = Components.classes['@mozilla.org/network/http-auth-manager;1']
                           .getService(Components.interfaces.nsIHttpAuthManager);
   authMgr.clearAll();
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_auth4.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_auth4.js
@@ -41,13 +41,13 @@ function install_ended(install, addon) {
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
   var authMgr = Components.classes['@mozilla.org/network/http-auth-manager;1']
                           .getService(Components.interfaces.nsIHttpAuthManager);
   authMgr.clearAll();
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeTab(gNewTab);
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_badhash.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_badhash.js
@@ -21,13 +21,13 @@ function test() {
 }
 
 function download_failed(install) {
   is(install.error, AddonManager.ERROR_INCORRECT_HASH, "Install should fail");
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
-  Services.perms.remove(makeURI("http://example.com/"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_badhashtype.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_badhashtype.js
@@ -21,13 +21,13 @@ function test() {
 }
 
 function download_failed(install) {
   is(install.error, AddonManager.ERROR_INCORRECT_HASH, "Install should fail");
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
-  Services.perms.remove(makeURI("http://example.com/"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_bug540558.js
@@ -13,13 +13,13 @@ function test() {
 }
 
 function check_xpi_install(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_bug645699.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_bug645699.js
@@ -23,14 +23,14 @@ function allow_blocked(installInfo) {
 
 function confirm_install(window) {
   ok(false, "Should not see the install dialog");
   return false;
 }
 
 function finish_test(count) {
   is(count, 0, "0 Add-ons should have been successfully installed");
-  Services.perms.remove(makeURI("http://addons.mozilla.org"), "install");
+  Services.perms.remove("addons.mozilla.org", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
 // ----------------------------------------------------------------------------
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_bug672485.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_bug672485.js
@@ -41,12 +41,12 @@ function complete_install() {
 
 function finish_test(count) {
   is(count, 0, "0 Add-ons should have been successfully installed");
 
   gBrowser.removeCurrentTab();
 
   Services.ww = gWindowWatcher;
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cancel.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cancel.js
@@ -50,13 +50,13 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   ok(false, "Should not have seen installs complete");
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_concurrent_installs.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_concurrent_installs.js
@@ -76,18 +76,18 @@ function test() {
   Services.wm.addListener(gAddonAndWindowListener);
   AddonManager.addInstallListener(gAddonAndWindowListener);
   registerCleanupFunction(function() {
     Services.wm.removeListener(gAddonAndWindowListener);
     AddonManager.removeInstallListener(gAddonAndWindowListener);
     Services.prefs.clearUserPref(PREF_LOGGING_ENABLED);
     Services.prefs.clearUserPref(PREF_INSTALL_REQUIRESECUREORIGIN);
 
-    Services.perms.remove(makeURI("http://example.com"), "install");
-    Services.perms.remove(makeURI("http://example.org"), "install");
+    Services.perms.remove("example.com", "install");
+    Services.perms.remove("example.org", "install");
 
     while (gConcurrentTabs.length) {
       gBrowser.removeTab(gConcurrentTabs.shift());
     }
   });
 
   let pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies.js
@@ -18,13 +18,13 @@ function test() {
 }
 
 function download_failed(install) {
   is(install.error, AddonManager.ERROR_NETWORK_FAILURE, "Install should fail");
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
@@ -28,13 +28,13 @@ function install_ended(install, addon) {
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
   var cm = Components.classes["@mozilla.org/cookiemanager;1"]
                      .getService(Components.interfaces.nsICookieManager2);
   cm.remove("example.com", "xpinstall", "/browser/" + RELATIVE_DIR, false);
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
@@ -32,13 +32,13 @@ function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
   var cm = Components.classes["@mozilla.org/cookiemanager;1"]
                      .getService(Components.interfaces.nsICookieManager2);
   cm.remove("example.com", "xpinstall", "/browser/" + RELATIVE_DIR, false);
 
   Services.prefs.clearUserPref("network.cookie.cookieBehavior");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
@@ -31,13 +31,13 @@ function download_failed(install) {
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
   var cm = Components.classes["@mozilla.org/cookiemanager;1"]
                      .getService(Components.interfaces.nsICookieManager2);
   cm.remove("example.org", "xpinstall", "/browser/" + RELATIVE_DIR, false);
 
   Services.prefs.clearUserPref("network.cookie.cookieBehavior");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_corrupt.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_corrupt.js
@@ -17,16 +17,16 @@ function test() {
 }
 
 function download_failed(install) {
   is(install.error, AddonManager.ERROR_CORRUPT_FILE, "Install should fail");
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   var doc = gBrowser.contentDocument;
   is(doc.getElementById("status").textContent, "-207", "Callback should have seen the failure");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_empty.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_empty.js
@@ -16,13 +16,13 @@ function test() {
 }
 
 function download_failed(install) {
   is(install.error, AddonManager.ERROR_CORRUPT_FILE, "Install should fail");
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_hash.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_hash.js
@@ -22,13 +22,13 @@ function test() {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_hash2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_hash2.js
@@ -22,13 +22,13 @@ function test() {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_httphash.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_httphash.js
@@ -26,14 +26,14 @@ function test() {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
   Services.prefs.clearUserPref(PREF_INSTALL_REQUIREBUILTINCERTS);
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_httphash2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_httphash2.js
@@ -26,14 +26,14 @@ function test() {
 
 function download_failed(install) {
   is(install.error, AddonManager.ERROR_INCORRECT_HASH, "Download should fail");
 }
 
 function finish_test(count) {
   is(count, 0, "0 Add-ons should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
   Services.prefs.clearUserPref(PREF_INSTALL_REQUIREBUILTINCERTS);
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_httphash3.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_httphash3.js
@@ -26,14 +26,14 @@ function test() {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
   Services.prefs.clearUserPref(PREF_INSTALL_REQUIREBUILTINCERTS);
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_httphash4.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_httphash4.js
@@ -24,13 +24,13 @@ function test() {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_httphash5.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_httphash5.js
@@ -27,14 +27,14 @@ function test() {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
   Services.prefs.clearUserPref(PREF_INSTALL_REQUIREBUILTINCERTS);
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_httphash6.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_httphash6.js
@@ -70,14 +70,14 @@ function finish_failed_download() {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
   Services.prefs.clearUserPref(PREF_INSTALL_REQUIREBUILTINCERTS);
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_installchrome.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_installchrome.js
@@ -13,13 +13,13 @@ function test() {
 }
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway.js
@@ -24,13 +24,13 @@ function download_progress(addon, value,
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_navigateaway2.js
@@ -24,12 +24,12 @@ function download_progress(addon, value,
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_offline.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_offline.js
@@ -50,12 +50,12 @@ function finish_test(count) {
 
   is(count, 0, "No add-ons should have been installed");
   try {
     Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
     Services.io.offline = false;
   } catch (ex) {
   }
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   wait_for_online();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_relative.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_relative.js
@@ -33,17 +33,17 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   var doc = gBrowser.contentDocument;
   is(doc.getElementById("return").textContent, "true", "installTrigger should have claimed success");
   is(doc.getElementById("status").textContent, "0", "Callback should have seen a success");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_signed_multiple.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_signed_multiple.js
@@ -60,13 +60,13 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 5, "5 Add-ons should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_signed_naming.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_signed_naming.js
@@ -55,13 +55,13 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 3, "3 Add-ons should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_signed_tampered.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_signed_tampered.js
@@ -21,13 +21,13 @@ function confirm_install(window) {
 }
 
 function download_failed(install) {
   is(install.error, AddonManager.ERROR_CORRUPT_FILE, "Install should fail");
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_signed_trigger.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_signed_trigger.js
@@ -29,13 +29,13 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_signed_untrusted.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_signed_untrusted.js
@@ -28,14 +28,14 @@ function confirm_install(window) {
 }
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
 // ----------------------------------------------------------------------------
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_softwareupdate.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_softwareupdate.js
@@ -13,13 +13,13 @@ function test() {
 }
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_switchtab.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_switchtab.js
@@ -37,13 +37,13 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeTab(expectedTab);
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_trigger_redirect.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_trigger_redirect.js
@@ -26,16 +26,16 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   var doc = gBrowser.contentDocument;
   is(gBrowser.currentURI.spec, TESTROOT + "triggerredirect.html#foo", "Should have redirected");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger.js
@@ -34,17 +34,17 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   var doc = gBrowser.contentDocument;
   is(doc.getElementById("return").textContent, "true", "installTrigger should have claimed success");
   is(doc.getElementById("status").textContent, "0", "Callback should have seen a success");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger_iframe.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger_iframe.js
@@ -35,17 +35,17 @@ function confirm_install(window) {
 
 function install_ended(install, addon) {
   install.cancel();
 }
 
 function finish_test(count) {
   is(count, 1, "1 Add-on should have been successfully installed");
 
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   var doc = gBrowser.contentWindow.frames[0].document; // Document of iframe
   is(doc.getElementById("return").textContent, "true", "installTrigger in iframe should have claimed success");
   is(doc.getElementById("status").textContent, "0", "Callback in iframe should have seen a success");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist2.js
@@ -19,13 +19,13 @@ function test() {
 
 function allow_blocked(installInfo) {
   is(installInfo.browser, gBrowser.selectedBrowser, "Install should have been triggered by the right browser");
   is(installInfo.originatingURI.spec, gBrowser.currentURI.spec, "Install should have been triggered by the right uri");
   return false;
 }
 
 function finish_test() {
-  Services.perms.remove(makeURI("http://example.org"), "install");
+  Services.perms.remove("example.org", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist3.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist3.js
@@ -17,13 +17,13 @@ function test() {
 }
 
 function confirm_install(window) {
   return false;
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
-  Services.perms.remove(makeURI("http://example.org"), "install");
+  Services.perms.remove("example.org", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist4.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist4.js
@@ -19,13 +19,13 @@ function test() {
 function allow_blocked(installInfo) {
   is(installInfo.browser, gBrowser.selectedBrowser, "Install should have been triggered by the right browser");
   is(installInfo.originatingURI.spec, TESTROOT2 + "test.html", "Install should have been triggered by the right uri");
   return false;
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
-  Services.perms.remove(makeURI("http://example.com"), "install");
+  Services.perms.remove("example.com", "install");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist7.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_whitelist7.js
@@ -17,14 +17,14 @@ function test() {
 function allow_blocked(installInfo) {
   ok(true, "Seen blocked");
   return false;
 }
 
 function finish_test(count) {
   is(count, 0, "No add-ons should have been installed");
 
-  Services.perms.remove(makeURI("http://example.org"), "install");
+  Services.perms.remove("example.org", "install");
   Services.prefs.clearUserPref("xpinstall.whitelist.directRequest");
 
   gBrowser.removeCurrentTab();
   Harness.finish();
 }