Bug 1858509 add thread-safety annotations around MediaSourceDemuxer::mMonitor r=alwu
[gecko.git] / layout / style / FontLoaderUtils.h
blobfed06e16d57961bd43b7184ddb67608dcdb649f2
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 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);
47 private:
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_