netwerk/cookie/PCookieService.ipdl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/cookie/PCookieService.ipdl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,110 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
     1.6 +
     1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +include protocol PNecko;
    1.12 +include URIParams;
    1.13 +
    1.14 +
    1.15 +using class IPC::SerializedLoadContext from "SerializedLoadContext.h";
    1.16 +
    1.17 +namespace mozilla {
    1.18 +namespace net {
    1.19 +
    1.20 +/**
    1.21 + * PCookieService
    1.22 + *
    1.23 + * Provides IPDL methods for setting and getting cookies. These are stored on
    1.24 + * and managed by the parent; the child process goes through the parent for
    1.25 + * all cookie operations. Lower-level programmatic operations (i.e. those
    1.26 + * provided by the nsICookieManager and nsICookieManager2 interfaces) are not
    1.27 + * currently implemented and requesting these interfaces in the child will fail.
    1.28 + *
    1.29 + * @see nsICookieService
    1.30 + * @see nsICookiePermission
    1.31 + */
    1.32 +
    1.33 +sync protocol PCookieService
    1.34 +{
    1.35 +  manager PNecko;
    1.36 +
    1.37 +parent:
    1.38 +
    1.39 +  /*
    1.40 +   * Get the complete cookie string associated with the URI. This is a sync
    1.41 +   * call in order to avoid race conditions -- for instance, an HTTP response
    1.42 +   * on the parent and script access on the child.
    1.43 +   *
    1.44 +   * @param host
    1.45 +   *        Same as the 'aURI' argument to nsICookieService.getCookieString.
    1.46 +   * @param isForeign
    1.47 +   *        True if the the request is third party, for purposes of allowing
    1.48 +   *        access to cookies. This should be obtained from
    1.49 +   *        mozIThirdPartyUtil.isThirdPartyChannel. Third party requests may be
    1.50 +   *        rejected depending on user preferences; if those checks are
    1.51 +   *        disabled, this parameter is ignored.
    1.52 +   * @param fromHttp
    1.53 +   *        Whether the result is for an HTTP request header. This should be
    1.54 +   *        true for nsICookieService.getCookieStringFromHttp calls, false
    1.55 +   *        otherwise.
    1.56 +   * @param loadContext
    1.57 +   *        The loadContext from the HTTP channel or document that the cookie is
    1.58 +   *        being set on.
    1.59 +   *
    1.60 +   * @see nsICookieService.getCookieString
    1.61 +   * @see nsICookieService.getCookieStringFromHttp
    1.62 +   * @see mozIThirdPartyUtil.isThirdPartyChannel
    1.63 +   *
    1.64 +   * @return the resulting cookie string.
    1.65 +   */
    1.66 +  sync GetCookieString(URIParams host,
    1.67 +                       bool isForeign,
    1.68 +                       bool fromHttp,
    1.69 +                       SerializedLoadContext loadContext)
    1.70 +       returns (nsCString result);
    1.71 +
    1.72 +  /*
    1.73 +   * Set a cookie string.
    1.74 +   *
    1.75 +   * @param host
    1.76 +   *        Same as the 'aURI' argument to nsICookieService.setCookieString.
    1.77 +   * @param isForeign
    1.78 +   *        True if the the request is third party, for purposes of allowing
    1.79 +   *        access to cookies. This should be obtained from
    1.80 +   *        mozIThirdPartyUtil.isThirdPartyChannel. Third party requests may be
    1.81 +   *        rejected depending on user preferences; if those checks are
    1.82 +   *        disabled, this parameter is ignored.
    1.83 +   * @param cookieString
    1.84 +   *        Same as the 'aCookie' argument to nsICookieService.setCookieString.
    1.85 +   * @param serverTime
    1.86 +   *        Same as the 'aServerTime' argument to
    1.87 +   *        nsICookieService.setCookieStringFromHttp. If the string is empty or
    1.88 +   *        null (e.g. for non-HTTP requests), the current local time is used.
    1.89 +   * @param fromHttp
    1.90 +   *        Whether the result is for an HTTP request header. This should be
    1.91 +   *        true for nsICookieService.setCookieStringFromHttp calls, false
    1.92 +   *        otherwise.
    1.93 +   * @param loadContext
    1.94 +   *        The loadContext from the HTTP channel or document that the cookie is
    1.95 +   *        being set on.
    1.96 +   *
    1.97 +   * @see nsICookieService.setCookieString
    1.98 +   * @see nsICookieService.setCookieStringFromHttp
    1.99 +   * @see mozIThirdPartyUtil.isThirdPartyChannel
   1.100 +   */
   1.101 +  SetCookieString(URIParams host,
   1.102 +                  bool isForeign,
   1.103 +                  nsCString cookieString,
   1.104 +                  nsCString serverTime,
   1.105 +                  bool fromHttp,
   1.106 +                  SerializedLoadContext loadContext);
   1.107 +
   1.108 +  __delete__();
   1.109 +};
   1.110 +
   1.111 +}
   1.112 +}
   1.113 +

mercurial