Bug 1734943 [wpt PR 31170] - Correct scrolling contents cull rect, a=testonly
[gecko.git] / uriloader / exthandler / HandlerServiceParent.h
blobe98e2f589e96b44698af256eb7eea88b0cff5c2d
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 handler_service_parent_h
8 #define handler_service_parent_h
10 #include "mozilla/dom/PHandlerServiceParent.h"
11 #include "nsIMIMEInfo.h"
13 class nsIHandlerApp;
15 class HandlerServiceParent final : public mozilla::dom::PHandlerServiceParent {
16 public:
17 HandlerServiceParent();
18 NS_INLINE_DECL_REFCOUNTING(HandlerServiceParent, final)
20 private:
21 virtual ~HandlerServiceParent();
22 void ActorDestroy(ActorDestroyReason aWhy) override;
24 mozilla::ipc::IPCResult RecvFillHandlerInfo(
25 const HandlerInfo& aHandlerInfoData, const nsCString& aOverrideType,
26 HandlerInfo* handlerInfoData) override;
28 mozilla::ipc::IPCResult RecvGetMIMEInfoFromOS(const nsCString& aMIMEType,
29 const nsCString& aExtension,
30 nsresult* aRv,
31 HandlerInfo* aHandlerInfoData,
32 bool* aFound) override;
34 mozilla::ipc::IPCResult RecvExists(const HandlerInfo& aHandlerInfo,
35 bool* exists) override;
37 mozilla::ipc::IPCResult RecvGetTypeFromExtension(
38 const nsCString& aFileExtension, nsCString* type) override;
40 mozilla::ipc::IPCResult RecvExistsForProtocolOS(
41 const nsCString& aProtocolScheme, bool* aHandlerExists) override;
43 mozilla::ipc::IPCResult RecvExistsForProtocol(
44 const nsCString& aProtocolScheme, bool* aHandlerExists) override;
46 mozilla::ipc::IPCResult RecvGetApplicationDescription(
47 const nsCString& aScheme, nsresult* aRv, nsString* aDescription) override;
50 * Limit the length of MIME types, filename extensions, and protocol
51 * schemes we'll consider.
53 static const size_t MAX_MIMETYPE_LENGTH = 129; /* Per RFC 6838, type and
54 subtype should be limited
55 to 64 characters. We add
56 one more to account for
57 a '/' separator. */
58 static const size_t MAX_EXT_LENGTH = 64; /* Arbitratily chosen to be
59 longer than any known
60 extension */
61 static const size_t MAX_SCHEME_LENGTH = 1024; /* Arbitratily chosen to be
62 longer than any known
63 protocol scheme */
66 #endif