gecko-dev/netwerk/ipc/NeckoChild.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

113 строки
4.5 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 {
friend class PNeckoChild;
2009-08-18 23:05:15 +04:00
public:
NeckoChild() = default;
2009-08-18 23:05:15 +04:00
virtual ~NeckoChild();
static void InitNeckoChild();
protected:
PStunAddrsRequestChild* AllocPStunAddrsRequestChild();
bool DeallocPStunAddrsRequestChild(PStunAddrsRequestChild* aActor);
PWebrtcProxyChannelChild* AllocPWebrtcProxyChannelChild(const TabId& tabId);
bool DeallocPWebrtcProxyChannelChild(PWebrtcProxyChannelChild* aActor);
PAltDataOutputStreamChild* AllocPAltDataOutputStreamChild(
const nsCString& type, const int64_t& predictedSize,
PHttpChannelChild* channel);
bool DeallocPAltDataOutputStreamChild(PAltDataOutputStreamChild* aActor);
already_AddRefed<PDocumentChannelChild> AllocPDocumentChannelChild(
const PBrowserOrId& aBrowser, const SerializedLoadContext& aSerialized,
const DocumentChannelCreationArgs& args);
PCookieServiceChild* AllocPCookieServiceChild();
bool DeallocPCookieServiceChild(PCookieServiceChild*);
PFTPChannelChild* AllocPFTPChannelChild(
const PBrowserOrId& aBrowser, const SerializedLoadContext& aSerialized,
const FTPChannelCreationArgs& aOpenArgs);
bool DeallocPFTPChannelChild(PFTPChannelChild*);
PWebSocketChild* AllocPWebSocketChild(const PBrowserOrId&,
const SerializedLoadContext&,
const uint32_t&);
bool DeallocPWebSocketChild(PWebSocketChild*);
PTCPSocketChild* AllocPTCPSocketChild(const nsString& host,
const uint16_t& port);
bool DeallocPTCPSocketChild(PTCPSocketChild*);
PTCPServerSocketChild* AllocPTCPServerSocketChild(
const uint16_t& aLocalPort, const uint16_t& aBacklog,
const bool& aUseArrayBuffers);
bool DeallocPTCPServerSocketChild(PTCPServerSocketChild*);
PUDPSocketChild* AllocPUDPSocketChild(nsIPrincipal* aPrincipal,
const nsCString& aFilter);
bool DeallocPUDPSocketChild(PUDPSocketChild*);
PDNSRequestChild* AllocPDNSRequestChild(
const nsCString& aHost, const OriginAttributes& aOriginAttributes,
const uint32_t& aFlags);
bool DeallocPDNSRequestChild(PDNSRequestChild*);
PSimpleChannelChild* AllocPSimpleChannelChild(const uint32_t& channelId);
bool DeallocPSimpleChannelChild(PSimpleChannelChild* child);
PChannelDiverterChild* AllocPChannelDiverterChild(
const ChannelDiverterArgs& channel);
bool DeallocPChannelDiverterChild(PChannelDiverterChild* actor);
PTransportProviderChild* AllocPTransportProviderChild();
bool DeallocPTransportProviderChild(PTransportProviderChild* aActor);
mozilla::ipc::IPCResult RecvAsyncAuthPromptForNestedFrame(
const TabId& aNestedFrameId, const nsCString& aUri,
const nsString& aRealm, const uint64_t& aCallbackId);
PWebSocketEventListenerChild* AllocPWebSocketEventListenerChild(
const uint64_t& aInnerWindowID);
bool DeallocPWebSocketEventListenerChild(PWebSocketEventListenerChild*);
/* Predictor Messsages */
mozilla::ipc::IPCResult RecvPredOnPredictPrefetch(
const URIParams& aURI, const uint32_t& aHttpStatus);
mozilla::ipc::IPCResult RecvPredOnPredictPreconnect(const URIParams& aURI);
mozilla::ipc::IPCResult RecvPredOnPredictDNS(const URIParams& aURI);
mozilla::ipc::IPCResult RecvSpeculativeConnectRequest();
mozilla::ipc::IPCResult RecvNetworkChangeNotification(nsCString const& type);
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
PClassifierDummyChannelChild* AllocPClassifierDummyChannelChild(
nsIURI* aURI, nsIURI* aTopWindowURI,
nsIPrincipal* aContentBlockingAllowListPrincipal,
const nsresult& aTopWindowURIResult,
const Maybe<LoadInfoArgs>& aLoadInfo);
bool DeallocPClassifierDummyChannelChild(
PClassifierDummyChannelChild* aChannel);
PProxyConfigLookupChild* AllocPProxyConfigLookupChild();
bool DeallocPProxyConfigLookupChild(PProxyConfigLookupChild* aActor);
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