Bug 1760193 [wpt PR 33188] - Update wpt metadata, a=testonly
[gecko.git] / uriloader / exthandler / ContentHandlerService.h
blob81d0c44148aa29819d20707dfd09466bc5469b9c
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 private:
34 virtual ~ContentHandlerService();
35 RefPtr<HandlerServiceChild> mHandlerServiceChild;
36 nsClassHashtable<nsCStringHashKey, nsCString> mExtToTypeMap;
39 class RemoteHandlerApp : public nsIHandlerApp {
40 public:
41 NS_DECL_ISUPPORTS
42 NS_DECL_NSIHANDLERAPP
44 explicit RemoteHandlerApp(HandlerApp aAppChild) : mAppChild(aAppChild) {}
46 private:
47 virtual ~RemoteHandlerApp() {}
48 HandlerApp mAppChild;
51 } // namespace dom
52 } // namespace mozilla
53 #endif