Bug 1330467 - part 6. Use principal for permissions in sitePermissions.js; r=johannh
authorLiang-Heng Chen <xeonchen@gmail.com>
Tue, 07 May 2019 22:17:09 +0000
changeset 535280 35d96a4ff6592595d15e470fde508f62d5f6fb1e
parent 535279 6ac44130d2bb05cc6cadb5cd642bbe7fe90ca08a
child 535281 b43fa07d5756d6206f41a4f4a7da6758b2a09690
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1330467
milestone68.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 1330467 - part 6. Use principal for permissions in sitePermissions.js; r=johannh Differential Revision: https://phabricator.services.mozilla.com/D19927
browser/components/preferences/sitePermissions.js
--- a/browser/components/preferences/sitePermissions.js
+++ b/browser/components/preferences/sitePermissions.js
@@ -369,23 +369,21 @@ var gSitePermissionsManager = {
 
   onApplyChanges() {
     // Stop observing permission changes since we are about
     // to write out the pending adds/deletes and don't need
     // to update the UI
     this.uninit();
 
     for (let p of this._permissionsToChange.values()) {
-      let uri = Services.io.newURI(p.origin);
-      SitePermissions.set(uri, p.type, p.capability);
+      SitePermissions.setForPrincipal(p.principal, p.type, p.capability);
     }
 
     for (let p of this._permissionsToDelete.values()) {
-      let uri = Services.io.newURI(p.origin);
-      SitePermissions.remove(uri, p.type);
+      SitePermissions.removeFromPrincipal(p.principal, p.type);
     }
 
     if (this._checkbox.checked) {
       Services.prefs.setIntPref(this._defaultPermissionStatePrefName, SitePermissions.BLOCK);
     } else if (this._currentDefaultPermissionsState == SitePermissions.BLOCK) {
       Services.prefs.setIntPref(this._defaultPermissionStatePrefName, SitePermissions.UNKNOWN);
     }