gfx/thebes/gfxFontSrcPrincipal.cpp
author moz-wptsync-bot <wptsync@mozilla.com>
Thu, 08 Nov 2018 08:22:51 +0000
changeset 506788 f62150dda3664620284888933718cef568d96558
parent 506367 edff28b27f207b3d6e592b131bd0f7bf94da9982
child 508163 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
Bug 1505638 [wpt PR 13972] - Update wpt metadata, a=testonly wpt-pr: 13972 wpt-type: metadata

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "gfxFontSrcPrincipal.h"

#include "nsProxyRelease.h"
#include "nsURIHashKey.h"
#include "mozilla/BasePrincipal.h"

using mozilla::BasePrincipal;

gfxFontSrcPrincipal::gfxFontSrcPrincipal(nsIPrincipal* aPrincipal)
{
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(aPrincipal);

  mPrincipal = aPrincipal;

  mHash = mPrincipal->GetHashValue();
}

gfxFontSrcPrincipal::~gfxFontSrcPrincipal()
{
  NS_ReleaseOnMainThreadSystemGroup("gfxFontSrcPrincipal::mPrincipal",
                                    mPrincipal.forget());
}

bool
gfxFontSrcPrincipal::Equals(gfxFontSrcPrincipal* aOther)
{
  return BasePrincipal::Cast(mPrincipal)->
           FastEquals(BasePrincipal::Cast(aOther->mPrincipal));
}