Bug 1890277: part 1) Add CSP parser tests for `require-trusted-types-for`. r=tschuster
[gecko.git] / uriloader / exthandler / ContentHandlerService.h
blob650dbd91159b99dce052090543dd5ca103cbc0b0
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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef ContentHandlerService_h
8 #define ContentHandlerService_h
10 #include "mozilla/dom/PHandlerService.h"
11 #include "nsIHandlerService.h"
12 #include "nsClassHashtable.h"
13 #include "nsIMIMEInfo.h"
15 namespace mozilla {
17 class HandlerServiceChild;
19 namespace dom {
21 class PHandlerServiceChild;
23 class ContentHandlerService : public nsIHandlerService {
24 public:
25 NS_DECL_ISUPPORTS
26 NS_DECL_NSIHANDLERSERVICE
28 ContentHandlerService();
29 [[nodiscard]] nsresult Init();
30 static void nsIHandlerInfoToHandlerInfo(nsIHandlerInfo* aInfo,
31 HandlerInfo* aHandlerInfo);
33 static already_AddRefed<nsIHandlerService> Create();
35 private:
36 virtual ~ContentHandlerService();
37 RefPtr<HandlerServiceChild> mHandlerServiceChild;
38 nsClassHashtable<nsCStringHashKey, nsCString> mExtToTypeMap;
41 class RemoteHandlerApp : public nsIHandlerApp {
42 public:
43 NS_DECL_ISUPPORTS
44 NS_DECL_NSIHANDLERAPP
46 explicit RemoteHandlerApp(HandlerApp aAppChild) : mAppChild(aAppChild) {}
48 private:
49 virtual ~RemoteHandlerApp() {}
50 HandlerApp mAppChild;
53 } // namespace dom
54 } // namespace mozilla
55 #endif