Commit 59df9586 authored by Sebastian Hengst's avatar Sebastian Hengst
Browse files

Backed out changeset 0e4ee0af3ff0 (bug 1337056)

parent 9e2e9cf6
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -2055,6 +2055,7 @@ ContentParent::ContentParent(ContentParent* aOpener,
  , mNumDestroyingTabs(0)
  , mIsAvailable(true)
  , mIsAlive(true)
  , mSendPermissionUpdates(false)
  , mIsForBrowser(!mRemoteType.IsEmpty())
  , mCalledClose(false)
  , mCalledKillHard(false)
@@ -5045,12 +5046,6 @@ ContentParent::EnsurePermissionsByKey(const nsCString& aKey)
#endif
}

bool
ContentParent::NeedsPermissionsUpdate(const nsACString& aPermissionKey) const
{
  return mActivePermissionKeys.Contains(aPermissionKey);
}

mozilla::ipc::IPCResult
ContentParent::RecvAccumulateChildHistograms(
                InfallibleTArray<Accumulation>&& aAccumulations)
+5 −1
Original line number Diff line number Diff line
@@ -377,7 +377,10 @@ public:
    return mScriptableHelper;
  }

  bool NeedsPermissionsUpdate(const nsACString& aPermissionKey) const;
  bool NeedsPermissionsUpdate() const
  {
    return mSendPermissionUpdates;
  }

  /**
   * Kill our subprocess and make sure it dies.  Should only be used
@@ -1165,6 +1168,7 @@ private:
  // still pass through.
  bool mIsAlive;

  bool mSendPermissionUpdates;
  bool mIsForBrowser;

  // These variables track whether we've called Close() and KillHard() on our
+1 −4
Original line number Diff line number Diff line
@@ -1568,14 +1568,11 @@ nsPermissionManager::AddInternal(nsIPrincipal* aPrincipal,
    IPC::Permission permission(origin, aType, aPermission,
                               aExpireType, aExpireTime);

    nsAutoCString permissionKey;
    GetKeyForPrincipal(aPrincipal, permissionKey);

    nsTArray<ContentParent*> cplist;
    ContentParent::GetAll(cplist);
    for (uint32_t i = 0; i < cplist.Length(); ++i) {
      ContentParent* cp = cplist[i];
      if (cp->NeedsPermissionsUpdate(permissionKey))
      if (cp->NeedsPermissionsUpdate())
        Unused << cp->SendAddPermission(permission);
    }
  }