2019-08-07 08:54:53 +03:00
|
|
|
/* 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_DocumentChannelParent_h
|
|
|
|
#define mozilla_net_DocumentChannelParent_h
|
|
|
|
|
2020-06-09 18:55:08 +03:00
|
|
|
#include "mozilla/net/DocumentLoadListener.h"
|
2020-06-12 08:56:28 +03:00
|
|
|
#include "mozilla/net/PDocumentChannelParent.h"
|
2019-08-07 08:54:53 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
2020-03-06 00:15:50 +03:00
|
|
|
namespace dom {
|
|
|
|
class CanonicalBrowsingContext;
|
2020-04-23 11:49:51 +03:00
|
|
|
}
|
2019-08-07 08:54:53 +03:00
|
|
|
namespace net {
|
|
|
|
|
2019-11-20 06:29:25 +03:00
|
|
|
/**
|
2020-06-12 08:56:28 +03:00
|
|
|
* An actor that forwards all changes across to DocumentChannelChild, the
|
|
|
|
* nsIChannel implementation owned by a content process docshell.
|
2019-11-20 06:29:25 +03:00
|
|
|
*/
|
2020-08-18 19:49:34 +03:00
|
|
|
class DocumentChannelParent final
|
|
|
|
: public PDocumentChannelParent,
|
|
|
|
public DocumentLoadListener::ObjectUpgradeHandler {
|
2019-08-07 08:54:53 +03:00
|
|
|
public:
|
2019-11-20 06:29:25 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(DocumentChannelParent, override);
|
2019-08-07 08:54:53 +03:00
|
|
|
|
2020-04-26 03:53:37 +03:00
|
|
|
explicit DocumentChannelParent();
|
2019-12-04 02:55:04 +03:00
|
|
|
|
2020-04-26 03:53:37 +03:00
|
|
|
bool Init(dom::CanonicalBrowsingContext* aContext,
|
|
|
|
const DocumentChannelCreationArgs& aArgs);
|
2019-08-07 08:54:53 +03:00
|
|
|
|
2019-11-20 06:29:25 +03:00
|
|
|
// PDocumentChannelParent
|
2022-05-13 05:20:23 +03:00
|
|
|
ipc::IPCResult RecvCancel(const nsresult& aStatus) {
|
2020-06-12 08:56:28 +03:00
|
|
|
if (mDocumentLoadListener) {
|
|
|
|
mDocumentLoadListener->Cancel(aStatus);
|
2019-12-19 16:44:03 +03:00
|
|
|
}
|
2022-05-13 05:20:23 +03:00
|
|
|
return IPC_OK();
|
2019-08-07 08:54:53 +03:00
|
|
|
}
|
2019-11-20 06:29:25 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override {
|
2020-06-12 08:56:28 +03:00
|
|
|
if (mDocumentLoadListener) {
|
|
|
|
mDocumentLoadListener->Cancel(NS_BINDING_ABORTED);
|
2019-12-19 16:44:03 +03:00
|
|
|
}
|
2019-08-07 08:54:53 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2020-08-18 19:49:34 +03:00
|
|
|
RefPtr<ObjectUpgradePromise> UpgradeObjectLoad() override;
|
|
|
|
|
2019-11-20 04:48:32 +03:00
|
|
|
RefPtr<PDocumentChannelParent::RedirectToRealChannelPromise>
|
2020-04-09 10:03:49 +03:00
|
|
|
RedirectToRealChannel(
|
|
|
|
nsTArray<ipc::Endpoint<extensions::PStreamFilterParent>>&&
|
|
|
|
aStreamFilterEndpoints,
|
2020-06-12 08:56:28 +03:00
|
|
|
uint32_t aRedirectFlags, uint32_t aLoadFlags);
|
2019-11-15 05:42:06 +03:00
|
|
|
|
2020-04-24 04:58:23 +03:00
|
|
|
virtual ~DocumentChannelParent();
|
2019-11-15 05:42:06 +03:00
|
|
|
|
2020-06-12 08:56:28 +03:00
|
|
|
RefPtr<DocumentLoadListener> mDocumentLoadListener;
|
2019-08-07 08:54:53 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_net_DocumentChannelParent_h
|