Commit 84d3bcc3 authored by Sebastian Hengst's avatar Sebastian Hengst
Browse files

Backed out changeset 7a6e7570df3e (bug 1337056)

parent 59df9586
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@
#include "nsINavHistoryService.h"
#include "nsToolkitCompsCID.h"
#include "nsIObserverService.h"
#include "nsPrintfCString.h"

static nsPermissionManager *gPermissionManager = nullptr;

@@ -598,24 +597,6 @@ nsPermissionManager::PermissionKey::CreateFromPrincipal(nsIPrincipal* aPrincipal
    return nullptr;
  }

#ifdef DEBUG
  // Creating a PermissionsKey to look up a permission if we haven't had those keys
  // synced down yet is problematic, so we do a check here and emit an assertion if
  // we see it happening.
  if (XRE_IsContentProcess()) {
    nsAutoCString permissionKey;
    GetKeyForPrincipal(aPrincipal, permissionKey);

    // NOTE: Theoretically an addon could ask for permissions which the process
    // wouldn't have access to, and we wouldn't want to crash the process in
    // this case, but our chrome code should never do this. Using NS_ASSERTION
    // here so that we can test fetching unavaliable permissions in tests.
    NS_ASSERTION(gPermissionManager->mAvailablePermissionKeys.Contains(permissionKey),
                 nsPrintfCString("This content process hasn't received the "
                                 "permissions for %s yet", permissionKey.get()).get());
  }
#endif

  return new PermissionKey(origin);
}