gecko-dev/netwerk/ipc/NeckoChild.h

129 строки
6.3 KiB
C
Исходник Обычный вид История

2009-08-18 23:05:15 +04:00
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
2012-05-21 15:12:37 +04:00
/* 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/. */
2009-08-18 23:05:15 +04:00
#ifndef mozilla_net_NeckoChild_h
#define mozilla_net_NeckoChild_h
#include "mozilla/net/PNeckoChild.h"
#include "mozilla/net/NeckoCommon.h"
2009-08-18 23:05:15 +04:00
namespace mozilla {
namespace net {
// Header file contents
class NeckoChild :
public PNeckoChild
{
public:
NeckoChild() = default;
2009-08-18 23:05:15 +04:00
virtual ~NeckoChild();
static void InitNeckoChild();
protected:
virtual PHttpChannelChild*
AllocPHttpChannelChild(const PBrowserOrId&, const SerializedLoadContext&,
const HttpChannelCreationArgs& aOpenArgs) override;
virtual bool DeallocPHttpChannelChild(PHttpChannelChild*) override;
virtual PStunAddrsRequestChild* AllocPStunAddrsRequestChild() override;
virtual bool
DeallocPStunAddrsRequestChild(PStunAddrsRequestChild* aActor) override;
virtual PAltDataOutputStreamChild* AllocPAltDataOutputStreamChild(const nsCString& type, const int64_t& predictedSize, PHttpChannelChild* channel) override;
virtual bool DeallocPAltDataOutputStreamChild(PAltDataOutputStreamChild* aActor) override;
virtual PCookieServiceChild* AllocPCookieServiceChild() override;
virtual bool DeallocPCookieServiceChild(PCookieServiceChild*) override;
virtual PWyciwygChannelChild* AllocPWyciwygChannelChild() override;
virtual bool DeallocPWyciwygChannelChild(PWyciwygChannelChild*) override;
virtual PFTPChannelChild*
AllocPFTPChannelChild(const PBrowserOrId& aBrowser,
const SerializedLoadContext& aSerialized,
const FTPChannelCreationArgs& aOpenArgs) override;
virtual bool DeallocPFTPChannelChild(PFTPChannelChild*) override;
virtual PWebSocketChild*
AllocPWebSocketChild(const PBrowserOrId&,
const SerializedLoadContext&,
const uint32_t&) override;
virtual bool DeallocPWebSocketChild(PWebSocketChild*) override;
virtual PTCPSocketChild* AllocPTCPSocketChild(const nsString& host,
const uint16_t& port) override;
virtual bool DeallocPTCPSocketChild(PTCPSocketChild*) override;
virtual PTCPServerSocketChild*
AllocPTCPServerSocketChild(const uint16_t& aLocalPort,
const uint16_t& aBacklog,
const bool& aUseArrayBuffers) override;
virtual bool DeallocPTCPServerSocketChild(PTCPServerSocketChild*) override;
virtual PUDPSocketChild* AllocPUDPSocketChild(const Principal& aPrincipal,
const nsCString& aFilter) override;
virtual bool DeallocPUDPSocketChild(PUDPSocketChild*) override;
virtual PDNSRequestChild* AllocPDNSRequestChild(const nsCString& aHost,
const OriginAttributes& aOriginAttributes,
const uint32_t& aFlags) override;
virtual bool DeallocPDNSRequestChild(PDNSRequestChild*) override;
virtual PDataChannelChild* AllocPDataChannelChild(const uint32_t& channelId) override;
virtual bool DeallocPDataChannelChild(PDataChannelChild* child) override;
virtual PFileChannelChild* AllocPFileChannelChild(const uint32_t& channelId) override;
virtual bool DeallocPFileChannelChild(PFileChannelChild* child) override;
virtual PSimpleChannelChild* AllocPSimpleChannelChild(const uint32_t& channelId) override;
virtual bool DeallocPSimpleChannelChild(PSimpleChannelChild* child) override;
virtual PChannelDiverterChild*
AllocPChannelDiverterChild(const ChannelDiverterArgs& channel) override;
virtual bool
DeallocPChannelDiverterChild(PChannelDiverterChild* actor) override;
virtual PTransportProviderChild*
AllocPTransportProviderChild() override;
virtual bool
DeallocPTransportProviderChild(PTransportProviderChild* aActor) override;
virtual mozilla::ipc::IPCResult RecvAsyncAuthPromptForNestedFrame(const TabId& aNestedFrameId,
const nsCString& aUri,
const nsString& aRealm,
const uint64_t& aCallbackId) override;
virtual PWebSocketEventListenerChild*
AllocPWebSocketEventListenerChild(const uint64_t& aInnerWindowID) override;
virtual bool DeallocPWebSocketEventListenerChild(PWebSocketEventListenerChild*) override;
/* Predictor Messsages */
virtual mozilla::ipc::IPCResult RecvPredOnPredictPrefetch(const URIParams& aURI,
const uint32_t& aHttpStatus) override;
virtual mozilla::ipc::IPCResult RecvPredOnPredictPreconnect(const URIParams& aURI) override;
virtual mozilla::ipc::IPCResult RecvPredOnPredictDNS(const URIParams& aURI) override;
virtual mozilla::ipc::IPCResult RecvSpeculativeConnectRequest() override;
virtual mozilla::ipc::IPCResult RecvNetworkChangeNotification(nsCString const& type) override;
Bug 1476996 - Implement cross process redirection in Http on the parent process r=bagder,nika This patch builds the foundation for the ability to relocate HTTP channels from one content process to another in order to ensure that origins are properly isolated. This relocation would normally occur when the response to an HTTP request is a redirect to a different origin. The patch merely adds the mechanism for relocating the channel, rather than the logic of doing so. This will be provided in a follow-up patch by a specialized service. Right now that functionality is mocked in the test. How this works: In nsHttpChannel::OnStartRequest we will query the service that decides whether we need to direct the response to another process. If so, it will return a promise that resolves to a TabParent. When the promise resolves, in HttpChannelParentListener::TriggerCrossProcessRedirect we call NeckoParent::SendCrossProcessRedirect passing along the required information to recreate the channel in the new process. The NeckoChild in the new process will then instantiate a new channel, call ConnectParent() which creates the associated parent channel, and connects it with the existing nsHttpChannel. A listener in the new process is then notified of the existence of the new channel. It is required to call completeRedirectSetup on the channel, passing an nsIStreamListener to the call. We then finish the entire operation with a call to HttpChannelChild::SendCrossProcessRedirectDone which causes us to close the old HttpChannelChild in the previous process and to resume the nsHttpChannel in the main process. Differential Revision: https://phabricator.services.mozilla.com/D2958 --HG-- rename : netwerk/test/browser/browser_cookie_sync_across_tabs.js => netwerk/test/browser/browser_cross_process_redirect.js rename : dom/media/test/redirect.sjs => netwerk/test/browser/redirect.sjs extra : moz-landing-system : lando
2018-09-04 23:45:22 +03:00
virtual mozilla::ipc::IPCResult RecvCrossProcessRedirect(
const uint32_t& aRegistrarId,
nsIURI* aURI,
const uint32_t& aNewLoadFlags,
const OptionalLoadInfoArgs& aLoadInfoForwarder,
const uint64_t& aChannelId,
nsIURI* aOriginalURI,
const uint64_t& aIdentifier) override;
virtual PTrackingDummyChannelChild*
AllocPTrackingDummyChannelChild(nsIURI* aURI,
nsIURI* aTopWindowURI,
const nsresult& aTopWindowURIResult,
const OptionalLoadInfoArgs& aLoadInfo) override;
virtual bool
DeallocPTrackingDummyChannelChild(PTrackingDummyChannelChild* aChannel) override;
2009-08-18 23:05:15 +04:00
};
/**
* Reference to the PNecko Child protocol.
* Null if this is not a content process.
*/
extern PNeckoChild *gNeckoChild;
} // namespace net
} // namespace mozilla
#endif // mozilla_net_NeckoChild_h