Bug 815398 - Settings: set navigator.mozSettings to null if we don't have read or write permission. r=bent, a=blocking-basecamp
authorGregor Wagner <anygregor@gmail.com>
Mon, 26 Nov 2012 15:33:34 -0800
changeset 117149 56af2b75d36f3e18ebbf7519b8ee3721470000c6
parent 117148 3540f4d72972efe8527d294ee792a5d9e1908508
child 117150 bf2b5ac37ba780baf7a52b92392e98d33362b678
push id1761
push userryanvm@gmail.com
push dateWed, 28 Nov 2012 02:19:53 +0000
treeherdermozilla-beta@de989474fdec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent, blocking-basecamp
bugs815398
milestone18.0
Bug 815398 - Settings: set navigator.mozSettings to null if we don't have read or write permission. r=bent, a=blocking-basecamp
dom/settings/SettingsManager.js
--- a/dom/settings/SettingsManager.js
+++ b/dom/settings/SettingsManager.js
@@ -337,16 +337,17 @@ SettingsManager.prototype = {
 
     let readPerm = Services.perms.testExactPermissionFromPrincipal(aWindow.document.nodePrincipal, "settings-read");
     let writePerm = Services.perms.testExactPermissionFromPrincipal(aWindow.document.nodePrincipal, "settings-write");
     this.hasReadPrivileges = readPerm == Ci.nsIPermissionManager.ALLOW_ACTION;
     this.hasWritePrivileges = writePerm == Ci.nsIPermissionManager.ALLOW_ACTION;
 
     if (!this.hasReadPrivileges && !this.hasWritePrivileges) {
       Cu.reportError("NO SETTINGS PERMISSION FOR: " + aWindow.document.nodePrincipal.origin + "\n");
+      return null;
     }
   },
 
   observe: function(aSubject, aTopic, aData) {
     debug("Topic: " + aTopic);
     if (aTopic == "inner-window-destroyed") {
       let wId = aSubject.QueryInterface(Ci.nsISupportsPRUint64).data;
       if (wId == this.innerWindowID) {