1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GECKO_LAYOUT_STYLE_FONTLOADERUTILS_H_
8 #define GECKO_LAYOUT_STYLE_FONTLOADERUTILS_H_
10 #include "ErrorList.h"
11 #include "nsContentSecurityManager.h"
13 class gfxUserFontEntry
;
16 class nsIInterfaceRequestor
;
19 struct gfxFontFaceSrc
;
22 enum CORSMode
: uint8_t;
26 enum class ReferrerPolicy
: uint8_t;
29 class FontLoaderUtils
{
31 // @param aSuppportsPriorityValue See <nsISupportsPriority.idl>.
32 static nsresult
BuildChannel(nsIChannel
** aChannel
, nsIURI
* aURI
,
33 const CORSMode aCORSMode
,
34 const dom::ReferrerPolicy
& aReferrerPolicy
,
35 gfxUserFontEntry
* aUserFontEntry
,
36 const gfxFontFaceSrc
* aFontFaceSrc
,
37 dom::Document
* aDocument
,
38 nsILoadGroup
* aLoadGroup
,
39 nsIInterfaceRequestor
* aCallbacks
,
40 bool aIsPreload
, int32_t aSupportsPriorityValue
);
42 static nsresult
BuildChannel(nsIChannel
** aChannel
, nsIURI
* aURI
,
43 const CORSMode aCORSMode
,
44 const dom::ReferrerPolicy
& aReferrerPolicy
,
45 gfxUserFontEntry
* aUserFontEntry
,
46 const gfxFontFaceSrc
* aFontFaceSrc
,
47 dom::WorkerPrivate
* aWorkerPrivate
,
48 nsILoadGroup
* aLoadGroup
,
49 nsIInterfaceRequestor
* aCallbacks
);
52 static void BuildChannelFlags(
53 nsIURI
* aURI
, bool aIsPreload
,
54 nsContentSecurityManager::CORSSecurityMapping
& aCorsMapping
,
55 nsSecurityFlags
& aSecurityFlags
, nsContentPolicyType
& aContentPolicyType
);
57 static nsresult
BuildChannelSetup(nsIChannel
* aChannel
,
58 nsIHttpChannel
* aHttpChannel
,
59 nsIReferrerInfo
* aReferrerInfo
,
60 const gfxFontFaceSrc
* aFontFaceSrc
,
61 int32_t aSupportsPriorityValue
);
64 } // namespace mozilla
66 #endif // GECKO_LAYOUT_STYLE_FONTLOADERUTILS_H_