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_FONTSRCURI_H
7 #define MOZILLA_GFX_FONTSRCURI_H
11 #include "PLDHashTable.h"
17 } // namespace mozilla
20 * A wrapper for an nsIURI that can be used OMT, which has cached information
21 * useful for the gfxUserFontSet.
25 explicit gfxFontSrcURI(nsIURI
* aURI
);
27 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(gfxFontSrcURI
)
29 nsIURI
* get() { return mURI
; }
31 bool Equals(gfxFontSrcURI
* aOther
);
32 nsresult
GetSpec(nsACString
& aResult
);
33 nsCString
GetSpecOrDefault();
35 PLDHashNumber
Hash() const { return mHash
; }
36 bool InheritsSecurityContext() const { return mInheritsSecurityContext
; }
37 bool SyncLoadIsOK() const { return mSyncLoadIsOK
; }
43 nsCOMPtr
<nsIURI
> mURI
;
45 // If the nsIURI is an nsSimpleURI for a data: URL, this is a pointer to it.
46 // (Just a weak reference since mURI holds the strong reference.)
48 // We store this so that we don't duplicate the URL spec for data: URLs,
49 // which can be much larger than other URLs.
50 mozilla::net::nsSimpleURI
* mSimpleURI
;
52 // If the nsIURI is not an nsSimpleURI, this is its spec.
55 // Precomputed hash for mURI.
58 // Whether the nsIURI's protocol handler has the URI_INHERITS_SECURITY_CONTEXT
60 bool mInheritsSecurityContext
;
62 // Whether the nsIURI's protocol handler has teh URI_SYNC_LOAD_IS_OK flag.
66 #endif // MOZILLA_GFX_FONTSRCURI_H