netwerk/ipc/PNecko.ipdl
author Carsten "Tomcat" Book <cbook@mozilla.com>
Wed, 28 Oct 2015 14:28:59 +0100
changeset 269998 1e9c356aafe6ddec6a76c591e8118d4c96a84a0c
parent 269997 929a872c1f15ef81d7730d366d95983b2e287602
child 270089 0f42f6bc21a8df4a6662e3431a279c1913296a63
permissions -rw-r--r--
Backed out changeset 7393a036ce36 (bug 1215092) for failing on own tests on a CLOSED TREE

/* -*- 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 PWebSocketFrameListener;
include protocol PTCPSocket;
include protocol PTCPServerSocket;
include protocol PUDPSocket;
include protocol PRemoteOpenFile;
include protocol PDNSRequest;
include protocol PChannelDiverter;
include protocol PBlob; //FIXME: bug #792908
include protocol PFileDescriptorSet;
include protocol PDataChannel;

include protocol PRtspController;
include protocol PRtspChannel;
include URIParams;
include InputStreamParams;
include NeckoChannelParams;
include PBrowserOrId;

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 {

//-------------------------------------------------------------------
prio(normal upto urgent) sync protocol PNecko
{
  manager PContent;
  manages PHttpChannel;
  manages PCookieService;
  manages PWyciwygChannel;
  manages PFTPChannel;
  manages PWebSocket;
  manages PWebSocketFrameListener;
  manages PTCPSocket;
  manages PTCPServerSocket;
  manages PUDPSocket;
  manages PDNSRequest;
  manages PRemoteOpenFile;
  manages PDataChannel;
  manages PRtspController;
  manages PRtspChannel;
  manages PChannelDiverter;

parent:
  __delete__();

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

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

  PDNSRequest(nsCString hostName, uint32_t flags, nsCString networkInterface);

  PWebSocketFrameListener(uint64_t aInnerWindowID);

  /* Predictor Methods */
  PredPredict(OptionalURIParams targetURI, OptionalURIParams sourceURI,
              uint32_t reason, SerializedLoadContext loadContext,
              bool hasVerifier);
  PredLearn(URIParams targetURI, OptionalURIParams sourceURI,
            uint32_t reason, SerializedLoadContext loadContext);
  PredReset();

  PRemoteOpenFile(SerializedLoadContext loadContext,
                  URIParams fileuri,
                  OptionalURIParams appuri);

  SpeculativeConnect(URIParams uri, bool anonymous);
  HTMLDNSPrefetch(nsString hostname, uint16_t flags);
  CancelHTMLDNSPrefetch(nsString hostname, 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.
   */
  PDataChannel(uint32_t channelId);

  PRtspController();
  PRtspChannel(RtspChannelConnectArgs args);
  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
   */
  OnAuthAvailable(uint64_t callbackId, nsString user,
                  nsString password, nsString domain);
  OnAuthCancelled(uint64_t callbackId, bool userCancel);

  RemoveSchedulingContext(nsCString scid);

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
   */
  AsyncAuthPromptForNestedFrame(TabId nestedFrameId, nsCString uri,
                                nsString realm, uint64_t callbackId);
  // Notifies child that a given app is now offline (or online)
  AppOfflineStatus(uint32_t appId, bool offline);

  /* Predictor Methods */
  PredOnPredictPreconnect(URIParams uri);
  PredOnPredictDNS(URIParams uri);

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.
  PTCPSocket(nsString host, uint16_t port);
};


} // namespace net
} // namespace mozilla