Bug 1822393 - consistently use getGeckoViewDependency() in browser-engine-gecko....
[gecko.git] / layout / style / FontLoaderUtils.h
blob0c6c77866f4bd191a21dcf0ccb30929111e78107
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;
14 class nsIChannel;
15 class nsIHttpChannel;
16 class nsIInterfaceRequestor;
17 class nsILoadGroup;
18 class nsIURI;
19 struct gfxFontFaceSrc;
21 namespace mozilla {
22 enum CORSMode : uint8_t;
23 namespace dom {
24 class Document;
25 class WorkerPrivate;
26 enum class ReferrerPolicy : uint8_t;
27 } // namespace dom
29 class FontLoaderUtils {
30 public:
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);
51 private:
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_