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 static nsresult
BuildChannel(
32 nsIChannel
** aChannel
, nsIURI
* aURI
, const CORSMode aCORSMode
,
33 const dom::ReferrerPolicy
& aReferrerPolicy
,
34 gfxUserFontEntry
* aUserFontEntry
, const gfxFontFaceSrc
* aFontFaceSrc
,
35 dom::Document
* aDocument
, nsILoadGroup
* aLoadGroup
,
36 nsIInterfaceRequestor
* aCallbacks
, bool aIsPreload
);
38 static nsresult
BuildChannel(nsIChannel
** aChannel
, nsIURI
* aURI
,
39 const CORSMode aCORSMode
,
40 const dom::ReferrerPolicy
& aReferrerPolicy
,
41 gfxUserFontEntry
* aUserFontEntry
,
42 const gfxFontFaceSrc
* aFontFaceSrc
,
43 dom::WorkerPrivate
* aWorkerPrivate
,
44 nsILoadGroup
* aLoadGroup
,
45 nsIInterfaceRequestor
* aCallbacks
);
48 static void BuildChannelFlags(
49 nsIURI
* aURI
, bool aIsPreload
,
50 nsContentSecurityManager::CORSSecurityMapping
& aCorsMapping
,
51 nsSecurityFlags
& aSecurityFlags
, nsContentPolicyType
& aContentPolicyType
);
53 static nsresult
BuildChannelSetup(nsIChannel
* aChannel
,
54 nsIHttpChannel
* aHttpChannel
,
55 nsIReferrerInfo
* aReferrerInfo
,
56 const gfxFontFaceSrc
* aFontFaceSrc
);
59 } // namespace mozilla
61 #endif // GECKO_LAYOUT_STYLE_FONTLOADERUTILS_H_