tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

gfxFontSrcPrincipal.cpp (1014B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      2 * This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #include "gfxFontSrcPrincipal.h"
      7 
      8 #include "nsURIHashKey.h"
      9 #include "mozilla/BasePrincipal.h"
     10 
     11 using mozilla::BasePrincipal;
     12 
     13 gfxFontSrcPrincipal::gfxFontSrcPrincipal(nsIPrincipal* aNodePrincipal,
     14                                         nsIPrincipal* aStoragePrincipal)
     15    : mNodePrincipal(aNodePrincipal), mStoragePrincipal(aStoragePrincipal) {
     16  MOZ_ASSERT(NS_IsMainThread());
     17  MOZ_ASSERT(aNodePrincipal);
     18  MOZ_ASSERT(aStoragePrincipal);
     19  mHash = mStoragePrincipal->GetHashValue();
     20 }
     21 
     22 gfxFontSrcPrincipal::~gfxFontSrcPrincipal() = default;
     23 
     24 bool gfxFontSrcPrincipal::Equals(gfxFontSrcPrincipal* aOther) {
     25  return BasePrincipal::Cast(mStoragePrincipal)
     26      ->FastEquals(BasePrincipal::Cast(aOther->mStoragePrincipal));
     27 }