diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /netwerk/protocol/ftp/FTPChannelParent.h | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/protocol/ftp/FTPChannelParent.h')
-rw-r--r-- | netwerk/protocol/ftp/FTPChannelParent.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/netwerk/protocol/ftp/FTPChannelParent.h b/netwerk/protocol/ftp/FTPChannelParent.h new file mode 100644 index 0000000000..21ef7590bb --- /dev/null +++ b/netwerk/protocol/ftp/FTPChannelParent.h @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=8 et tw=80 : */ + +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef mozilla_net_FTPChannelParent_h +#define mozilla_net_FTPChannelParent_h + +#include "mozilla/net/PFTPChannelParent.h" +#include "mozilla/net/NeckoParent.h" +#include "nsIParentChannel.h" +#include "nsIInterfaceRequestor.h" +#include "nsIChannelEventSink.h" +#include "nsIFTPChannelParentInternal.h" + +class nsILoadContext; + +namespace mozilla { + +namespace dom { +class BrowserParent; +} // namespace dom + +namespace net { +class ChannelEventQueue; + +class FTPChannelParent final : public PFTPChannelParent, + public nsIParentChannel, + public nsIInterfaceRequestor, + public nsIChannelEventSink, + public nsIFTPChannelParentInternal { + public: + NS_DECL_ISUPPORTS + NS_DECL_NSIREQUESTOBSERVER + NS_DECL_NSISTREAMLISTENER + NS_DECL_NSIPARENTCHANNEL + NS_DECL_NSIINTERFACEREQUESTOR + NS_DECL_NSICHANNELEVENTSINK + + FTPChannelParent(dom::BrowserParent* aIframeEmbedding, + nsILoadContext* aLoadContext, + PBOverrideStatus aOverrideStatus); + + bool Init(const FTPChannelCreationArgs& aOpenArgs); + + NS_IMETHOD SetErrorMsg(const char* aMsg, bool aUseUTF8) override; + + protected: + virtual ~FTPChannelParent(); + + bool DoAsyncOpen(const URIParams& aURI, const uint64_t& aStartPos, + const nsCString& aEntityID, + const Maybe<IPCStream>& aUploadStream, + const Maybe<LoadInfoArgs>& aLoadInfoArgs, + const uint32_t& aLoadFlags); + + // used to connect redirected-to channel in parent with just created + // ChildChannel. Used during HTTP->FTP redirects. + bool ConnectChannel(const uint64_t& channelId); + + virtual mozilla::ipc::IPCResult RecvCancel(const nsresult& status) override; + virtual mozilla::ipc::IPCResult RecvSuspend() override; + virtual mozilla::ipc::IPCResult RecvResume() override; + + virtual void ActorDestroy(ActorDestroyReason why) override; + + // if configured to use HTTP proxy for FTP, this can an an HTTP channel. + nsCOMPtr<nsIChannel> mChannel; + + bool mIPCClosed; + + nsCOMPtr<nsILoadContext> mLoadContext; + + PBOverrideStatus mPBOverride; + + // Set to the canceled status value if the main channel was canceled. + nsresult mStatus; + + RefPtr<mozilla::dom::BrowserParent> mBrowserParent; + + RefPtr<ChannelEventQueue> mEventQ; + + nsCString mErrorMsg; + bool mUseUTF8; +}; + +} // namespace net +} // namespace mozilla + +#endif // mozilla_net_FTPChannelParent_h |