зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1527505 - Part 3: Compute the origin hash once when storing permissions; r=nika
Depends on D20230 Differential Revision: https://phabricator.services.mozilla.com/D20231 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
f017471b08
Коммит
4268da8938
|
@ -79,17 +79,19 @@ class nsPermissionManager final : public nsIPermissionManager,
|
|||
static PermissionKey* CreateFromOriginNoSuffix(
|
||||
const nsACString& aOriginNoSuffix);
|
||||
|
||||
explicit PermissionKey(const nsACString& aOrigin) : mOrigin(aOrigin) {}
|
||||
explicit PermissionKey(const nsACString& aOrigin)
|
||||
: mOrigin(aOrigin), mHashCode(mozilla::HashString(aOrigin)) {}
|
||||
|
||||
bool operator==(const PermissionKey& aKey) const {
|
||||
return mOrigin.Equals(aKey.mOrigin);
|
||||
}
|
||||
|
||||
PLDHashNumber GetHashCode() const { return mozilla::HashString(mOrigin); }
|
||||
PLDHashNumber GetHashCode() const { return mHashCode; }
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PermissionKey)
|
||||
|
||||
nsCString mOrigin;
|
||||
const nsCString mOrigin;
|
||||
const PLDHashNumber mHashCode;
|
||||
|
||||
private:
|
||||
// Default ctor shouldn't be used.
|
||||
|
|
Загрузка…
Ссылка в новой задаче