Bug 1287408 - Restor accidentally removed code for auto-allowing persisted permissions. r=dale
authorDão Gottwald <dao@mozilla.com>
Thu, 21 Jul 2016 17:23:13 +0200
changeset 346174 8c5a29a4fc59ed860f2ba6eac9971867e6ce4659
parent 346173 f5154aaeaec4546dd04c66ac61a0d0ee69f4dfdf
child 346175 4b83d342c9f79da4ec067392a1d5ed97e0edd683
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdale
bugs1287408
milestone50.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 1287408 - Restor accidentally removed code for auto-allowing persisted permissions. r=dale
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2786,27 +2786,27 @@ ContentPermissionPrompt.prototype = {
 
     var requestingPrincipal = request.principal;
     var requestingURI = requestingPrincipal.URI;
 
     // Ignore requests from non-nsIStandardURLs
     if (!(requestingURI instanceof Ci.nsIStandardURL))
       return;
 
-    var autoAllow = false;
     var permissionKey = kFeatureKeys[perm.type];
     var result = Services.perms.testExactPermissionFromPrincipal(requestingPrincipal, permissionKey);
 
     if (result == Ci.nsIPermissionManager.DENY_ACTION) {
       request.cancel();
       return;
     }
 
     if (result == Ci.nsIPermissionManager.ALLOW_ACTION) {
-      autoAllow = true;
+      request.allow();
+      return;
     }
 
     var browser = this._getBrowserForRequest(request);
     var chromeWin = browser.ownerGlobal;
     if (!chromeWin.PopupNotifications)
       // Ignore requests from browsers hosted in windows that don't support
       // PopupNotifications.
       return;