Line data Source code
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 "nsProxyRelease.h"
9 : #include "nsURIHashKey.h"
10 :
11 0 : gfxFontSrcPrincipal::gfxFontSrcPrincipal(nsIPrincipal* aPrincipal)
12 : {
13 0 : MOZ_ASSERT(NS_IsMainThread());
14 0 : MOZ_ASSERT(aPrincipal);
15 :
16 0 : mPrincipal = aPrincipal;
17 :
18 0 : uint32_t hash = 0;
19 0 : mPrincipal->GetHashValue(&hash);
20 0 : mHash = hash;
21 0 : }
22 :
23 0 : gfxFontSrcPrincipal::~gfxFontSrcPrincipal()
24 : {
25 : NS_ReleaseOnMainThread("gfxFontSrcPrincipal::mPrincipal",
26 0 : mPrincipal.forget());
27 0 : }
28 :
29 : bool
30 0 : gfxFontSrcPrincipal::Equals(gfxFontSrcPrincipal* aOther)
31 : {
32 : return BasePrincipal::Cast(mPrincipal)->
33 0 : FastEquals(BasePrincipal::Cast(aOther->mPrincipal));
34 : }
|