Bug 1684463 - [devtools] Part 1: Shorten the _createAttribute function by refactoring...
[gecko.git] / layout / style / FontPreloader.h
blob4749cd4bda9face6f39cc392de5fdcd909303b8a
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 FontPreloader_h_
8 #define FontPreloader_h_
10 #include "mozilla/FetchPreloader.h"
12 class gfxUserFontEntry;
13 struct gfxFontFaceSrc;
15 namespace mozilla {
17 class FontPreloader final : public FetchPreloader {
18 public:
19 FontPreloader();
21 // PreloaderBase
22 static void PrioritizeAsPreload(nsIChannel* aChannel);
23 void PrioritizeAsPreload() override;
25 static nsresult BuildChannel(
26 nsIChannel** aChannel, nsIURI* aURI, const CORSMode aCORSMode,
27 const dom::ReferrerPolicy& aReferrerPolicy,
28 gfxUserFontEntry* aUserFontEntry, const gfxFontFaceSrc* aFontFaceSrc,
29 dom::Document* aDocument, nsILoadGroup* aLoadGroup,
30 nsIInterfaceRequestor* aCallbacks, bool aIsPreload);
32 protected:
33 nsresult CreateChannel(nsIChannel** aChannel, nsIURI* aURI,
34 const CORSMode aCORSMode,
35 const dom::ReferrerPolicy& aReferrerPolicy,
36 dom::Document* aDocument, nsILoadGroup* aLoadGroup,
37 nsIInterfaceRequestor* aCallbacks) override;
40 } // namespace mozilla
42 #endif