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/. */
6 #ifndef MOZILLA_GFX_FONTSRCPRINCIPAL_H
7 #define MOZILLA_GFX_FONTSRCPRINCIPAL_H
10 #include "PLDHashTable.h"
18 } // namespace mozilla
21 * A wrapper for an nsIPrincipal that can be used OMT, which has cached
22 * information useful for the gfxUserFontSet.
24 * TODO(emilio): This has grown a bit more complex, but nsIPrincipal is now
25 * thread-safe, re-evaluate the existence of this class.
27 class gfxFontSrcPrincipal
{
29 explicit gfxFontSrcPrincipal(nsIPrincipal
* aNodePrincipal
,
30 nsIPrincipal
* aStoragePrincipal
);
32 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(gfxFontSrcPrincipal
)
34 nsIPrincipal
* NodePrincipal() const { return mNodePrincipal
; }
36 nsIPrincipal
* StoragePrincipal() const { return mStoragePrincipal
; }
38 bool Equals(gfxFontSrcPrincipal
* aOther
);
40 PLDHashNumber
Hash() const { return mHash
; }
43 ~gfxFontSrcPrincipal();
45 // The principal of the node.
46 nsCOMPtr
<nsIPrincipal
> mNodePrincipal
;
48 // The principal used for storage.
49 nsCOMPtr
<nsIPrincipal
> mStoragePrincipal
;
51 // Precomputed hash for mStoragePrincipal.
55 #endif // MOZILLA_GFX_FONTSRCPRINCIPAL_H