netwerk/ipc/PNecko.ipdl
author Nika Layzell <nika@thelayzells.com>
Tue, 21 Nov 2017 16:43:14 -0500
changeset 393469 a96b4dda871e4770820abaa2550c784b0bddbd2c
parent 377925 b37a0bd71bbb1f3e5b4f58f1936d9cc0a38851d2
child 406654 cd28092ce59a3055258af00afc35b2d05ef93d88
permissions -rw-r--r--
Bug 1419597 - Part 15: Build nsGlobalWindow{Inner,Outer}.cpp separately, r=smaug MozReview-Commit-ID: 7a1jiE7FKcs

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */

/* 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/. */

include protocol PContent;
include protocol PHttpChannel;
include protocol PCookieService;
include protocol PBrowser;
include protocol PWyciwygChannel;
include protocol PFTPChannel;
include protocol PWebSocket;
include protocol PWebSocketEventListener;
include protocol PTCPSocket;
include protocol PTCPServerSocket;
include protocol PUDPSocket;
include protocol PDNSRequest;
include protocol PChannelDiverter;
include protocol PFileDescriptorSet;
include protocol PDataChannel;
include protocol PSimpleChannel;
include protocol PTransportProvider;
include protocol PChildToParentStream; //FIXME: bug #792908
include protocol PParentToChildStream; //FIXME: bug #792908
include protocol PStunAddrsRequest;
include protocol PFileChannel;

include IPCStream;
include URIParams;
include NeckoChannelParams;
include PBrowserOrId;
include protocol PAltDataOutputStream;

using class IPC::SerializedLoadContext from "SerializedLoadContext.h";
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";

namespace mozilla {
namespace net {

//-------------------------------------------------------------------
nested(upto inside_cpow) sync protocol PNecko
{
  manager PContent;
  manages PHttpChannel;
  manages PCookieService;
  manages PWyciwygChannel;
  manages PFTPChannel;
  manages PWebSocket;
  manages PWebSocketEventListener;
  manages PTCPSocket;
  manages PTCPServerSocket;
  manages PUDPSocket;
  manages PDNSRequest;
  manages PDataChannel;
  manages PSimpleChannel;
  manages PFileChannel;
  manages PChannelDiverter;
  manages PTransportProvider;
  manages PAltDataOutputStream;
  manages PStunAddrsRequest;

parent:
  async __delete__();

  nested(inside_cpow) async PCookieService();
  async PHttpChannel(PBrowserOrId browser,
                     SerializedLoadContext loadContext,
                     HttpChannelCreationArgs args);
  async PWyciwygChannel();
  async PFTPChannel(PBrowserOrId browser, SerializedLoadContext loadContext,
                    FTPChannelCreationArgs args);

  async PWebSocket(PBrowserOrId browser, SerializedLoadContext loadContext,
                   uint32_t aSerialID);
  async PTCPServerSocket(uint16_t localPort, uint16_t backlog, bool useArrayBuffers);
  async PUDPSocket(Principal principal, nsCString filter);

  async PDNSRequest(nsCString hostName, OriginAttributes originAttributes,
                    uint32_t flags, nsCString networkInterface);

  async PWebSocketEventListener(uint64_t aInnerWindowID);

  /* Predictor Methods */
  async PredPredict(OptionalURIParams targetURI, OptionalURIParams sourceURI,
                    uint32_t reason, OriginAttributes originAttributes,
                    bool hasVerifier);
  async PredLearn(URIParams targetURI, OptionalURIParams sourceURI,
                  uint32_t reason, OriginAttributes originAttributes);
  async PredReset();

  async SpeculativeConnect(URIParams uri, Principal principal, bool anonymous);
  async HTMLDNSPrefetch(nsString hostname, OriginAttributes originAttributes,
                        uint16_t flags);
  async CancelHTMLDNSPrefetch(nsString hostname, OriginAttributes originAttributes,
                              uint16_t flags, nsresult reason);

  /**
   * channelId is used to establish a connection between redirect channels in
   * the parent and the child when we're redirecting to a data: URI.
   */
  async PDataChannel(uint32_t channelId);
  async PSimpleChannel(uint32_t channelId);
  async PFileChannel(uint32_t channelId);

  async PChannelDiverter(ChannelDiverterArgs channel);

  /**
   * These are called from the child with the results of the auth prompt.
   * callbackId is the id that was passed in PBrowser::AsyncAuthPrompt,
   * corresponding to an nsIAuthPromptCallback
   */
  async OnAuthAvailable(uint64_t callbackId, nsString user,
                        nsString password, nsString domain);
  async OnAuthCancelled(uint64_t callbackId, bool userCancel);

  async RequestContextLoadBegin(uint64_t rcid);
  async RequestContextAfterDOMContentLoaded(uint64_t rcid);
  async RemoveRequestContext(uint64_t rcid);

  async PAltDataOutputStream(nsCString type, PHttpChannel channel);

  async PStunAddrsRequest();

  /**
   * WebExtension-specific remote resource loading
   */
  async GetExtensionStream(URIParams uri) returns (OptionalIPCStream stream);
  async GetExtensionFD(URIParams uri) returns (FileDescriptor fd);

child:
  /*
   * Bring up the http auth prompt for a nested remote mozbrowser.
   * NestedFrameId is the id corresponding to the PBrowser.  It is the same id
   * that was passed to the PBrowserOrId param in to the PHttpChannel constructor
   */
  async AsyncAuthPromptForNestedFrame(TabId nestedFrameId, nsCString uri,
                                      nsString realm, uint64_t callbackId);

  /* Predictor Methods */
  async PredOnPredictPrefetch(URIParams uri, uint32_t httpStatus);
  async PredOnPredictPreconnect(URIParams uri);
  async PredOnPredictDNS(URIParams uri);

  async SpeculativeConnectRequest();

  async PTransportProvider();

both:
  // Actually we need PTCPSocket() for parent. But ipdl disallows us having different
  // signatures on parent and child. So when constructing the parent side object, we just
  // leave host/port unused.
  async PTCPSocket(nsString host, uint16_t port);
};


} // namespace net
} // namespace mozilla