michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */ michael@0: michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: include protocol PNecko; michael@0: include URIParams; michael@0: michael@0: michael@0: using class IPC::SerializedLoadContext from "SerializedLoadContext.h"; michael@0: michael@0: namespace mozilla { michael@0: namespace net { michael@0: michael@0: /** michael@0: * PCookieService michael@0: * michael@0: * Provides IPDL methods for setting and getting cookies. These are stored on michael@0: * and managed by the parent; the child process goes through the parent for michael@0: * all cookie operations. Lower-level programmatic operations (i.e. those michael@0: * provided by the nsICookieManager and nsICookieManager2 interfaces) are not michael@0: * currently implemented and requesting these interfaces in the child will fail. michael@0: * michael@0: * @see nsICookieService michael@0: * @see nsICookiePermission michael@0: */ michael@0: michael@0: sync protocol PCookieService michael@0: { michael@0: manager PNecko; michael@0: michael@0: parent: michael@0: michael@0: /* michael@0: * Get the complete cookie string associated with the URI. This is a sync michael@0: * call in order to avoid race conditions -- for instance, an HTTP response michael@0: * on the parent and script access on the child. michael@0: * michael@0: * @param host michael@0: * Same as the 'aURI' argument to nsICookieService.getCookieString. michael@0: * @param isForeign michael@0: * True if the the request is third party, for purposes of allowing michael@0: * access to cookies. This should be obtained from michael@0: * mozIThirdPartyUtil.isThirdPartyChannel. Third party requests may be michael@0: * rejected depending on user preferences; if those checks are michael@0: * disabled, this parameter is ignored. michael@0: * @param fromHttp michael@0: * Whether the result is for an HTTP request header. This should be michael@0: * true for nsICookieService.getCookieStringFromHttp calls, false michael@0: * otherwise. michael@0: * @param loadContext michael@0: * The loadContext from the HTTP channel or document that the cookie is michael@0: * being set on. michael@0: * michael@0: * @see nsICookieService.getCookieString michael@0: * @see nsICookieService.getCookieStringFromHttp michael@0: * @see mozIThirdPartyUtil.isThirdPartyChannel michael@0: * michael@0: * @return the resulting cookie string. michael@0: */ michael@0: sync GetCookieString(URIParams host, michael@0: bool isForeign, michael@0: bool fromHttp, michael@0: SerializedLoadContext loadContext) michael@0: returns (nsCString result); michael@0: michael@0: /* michael@0: * Set a cookie string. michael@0: * michael@0: * @param host michael@0: * Same as the 'aURI' argument to nsICookieService.setCookieString. michael@0: * @param isForeign michael@0: * True if the the request is third party, for purposes of allowing michael@0: * access to cookies. This should be obtained from michael@0: * mozIThirdPartyUtil.isThirdPartyChannel. Third party requests may be michael@0: * rejected depending on user preferences; if those checks are michael@0: * disabled, this parameter is ignored. michael@0: * @param cookieString michael@0: * Same as the 'aCookie' argument to nsICookieService.setCookieString. michael@0: * @param serverTime michael@0: * Same as the 'aServerTime' argument to michael@0: * nsICookieService.setCookieStringFromHttp. If the string is empty or michael@0: * null (e.g. for non-HTTP requests), the current local time is used. michael@0: * @param fromHttp michael@0: * Whether the result is for an HTTP request header. This should be michael@0: * true for nsICookieService.setCookieStringFromHttp calls, false michael@0: * otherwise. michael@0: * @param loadContext michael@0: * The loadContext from the HTTP channel or document that the cookie is michael@0: * being set on. michael@0: * michael@0: * @see nsICookieService.setCookieString michael@0: * @see nsICookieService.setCookieStringFromHttp michael@0: * @see mozIThirdPartyUtil.isThirdPartyChannel michael@0: */ michael@0: SetCookieString(URIParams host, michael@0: bool isForeign, michael@0: nsCString cookieString, michael@0: nsCString serverTime, michael@0: bool fromHttp, michael@0: SerializedLoadContext loadContext); michael@0: michael@0: __delete__(); michael@0: }; michael@0: michael@0: } michael@0: } michael@0: