2010-03-26 02:02:28 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
|
|
|
|
|
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/. */
|
2010-03-26 02:02:28 +03:00
|
|
|
|
2010-04-27 11:12:38 +04:00
|
|
|
include protocol PNecko;
|
2012-08-23 23:33:46 +04:00
|
|
|
include URIParams;
|
2017-08-03 14:00:41 +03:00
|
|
|
include NeckoChannelParams;
|
2010-04-17 06:56:36 +04:00
|
|
|
|
2017-01-12 19:38:48 +03:00
|
|
|
using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
|
2012-09-18 20:04:04 +04:00
|
|
|
|
2010-03-26 02:02:28 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2010-09-17 00:21:12 +04:00
|
|
|
/**
|
|
|
|
* PCookieService
|
|
|
|
*
|
|
|
|
* Provides IPDL methods for setting and getting cookies. These are stored on
|
|
|
|
* and managed by the parent; the child process goes through the parent for
|
|
|
|
* all cookie operations. Lower-level programmatic operations (i.e. those
|
2017-10-31 15:02:28 +03:00
|
|
|
* provided by the nsICookieManager interface) are not
|
2010-09-17 00:21:12 +04:00
|
|
|
* currently implemented and requesting these interfaces in the child will fail.
|
|
|
|
*
|
|
|
|
* @see nsICookieService
|
|
|
|
* @see nsICookiePermission
|
|
|
|
*/
|
|
|
|
|
2016-10-01 02:20:50 +03:00
|
|
|
nested(upto inside_cpow) sync protocol PCookieService
|
2010-03-26 02:02:28 +03:00
|
|
|
{
|
|
|
|
manager PNecko;
|
|
|
|
|
|
|
|
parent:
|
2010-09-17 00:21:12 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Set a cookie string.
|
|
|
|
*
|
|
|
|
* @param host
|
|
|
|
* Same as the 'aURI' argument to nsICookieService.setCookieString.
|
2018-04-12 13:52:51 +03:00
|
|
|
* @param channelURI
|
|
|
|
* The URI of the request.
|
2019-03-08 12:04:34 +03:00
|
|
|
* @param loadInfoArgs
|
|
|
|
* The optional serialization of nsILoadInfo.
|
2010-10-19 20:37:03 +04:00
|
|
|
* @param isForeign
|
|
|
|
* True if the the request is third party, for purposes of allowing
|
|
|
|
* access to cookies. This should be obtained from
|
|
|
|
* mozIThirdPartyUtil.isThirdPartyChannel. Third party requests may be
|
|
|
|
* rejected depending on user preferences; if those checks are
|
|
|
|
* disabled, this parameter is ignored.
|
2018-06-20 20:38:22 +03:00
|
|
|
* @param isTrackingResource
|
2018-07-10 11:09:59 +03:00
|
|
|
* True if the request has been marked as tracking.
|
|
|
|
* @param firstPartyStorageAccessGranted
|
|
|
|
* True if host has storage access granted. Note that the storage
|
|
|
|
* access is automatically granted also if the channel is not marked as
|
|
|
|
* tracking resource, or if it's not a 3rd party context.
|
2010-09-17 00:21:12 +04:00
|
|
|
* @param cookieString
|
|
|
|
* Same as the 'aCookie' argument to nsICookieService.setCookieString.
|
|
|
|
* @param serverTime
|
|
|
|
* Same as the 'aServerTime' argument to
|
|
|
|
* nsICookieService.setCookieStringFromHttp. If the string is empty or
|
|
|
|
* null (e.g. for non-HTTP requests), the current local time is used.
|
|
|
|
* @param fromHttp
|
|
|
|
* Whether the result is for an HTTP request header. This should be
|
|
|
|
* true for nsICookieService.setCookieStringFromHttp calls, false
|
|
|
|
* otherwise.
|
|
|
|
*
|
|
|
|
* @see nsICookieService.setCookieString
|
|
|
|
* @see nsICookieService.setCookieStringFromHttp
|
2010-10-19 20:37:03 +04:00
|
|
|
* @see mozIThirdPartyUtil.isThirdPartyChannel
|
2010-09-17 00:21:12 +04:00
|
|
|
*/
|
2016-10-01 02:20:50 +03:00
|
|
|
nested(inside_cpow) async SetCookieString(URIParams host,
|
2019-03-06 17:05:50 +03:00
|
|
|
URIParams? channelURI,
|
2019-03-08 12:04:34 +03:00
|
|
|
LoadInfoArgs? loadInfoArgs,
|
2016-10-01 02:20:50 +03:00
|
|
|
bool isForeign,
|
2018-06-20 20:38:22 +03:00
|
|
|
bool isTrackingResource,
|
2019-11-02 02:24:25 +03:00
|
|
|
bool isSocialTrackingResource,
|
2018-07-10 11:09:59 +03:00
|
|
|
bool firstPartyStorageAccessGranted,
|
2019-05-25 04:25:41 +03:00
|
|
|
uint32_t rejectedReason,
|
2019-04-12 08:30:43 +03:00
|
|
|
OriginAttributes aStoragePrincipalAttrs,
|
2016-10-01 02:20:50 +03:00
|
|
|
nsCString cookieString,
|
|
|
|
nsCString serverTime,
|
2017-05-20 07:47:59 +03:00
|
|
|
bool aFromHttp);
|
2010-03-26 02:02:28 +03:00
|
|
|
|
2017-08-03 14:00:41 +03:00
|
|
|
async PrepareCookieList(URIParams host,
|
|
|
|
bool isForeign,
|
2018-06-20 20:38:22 +03:00
|
|
|
bool isTrackingResource,
|
2019-11-02 02:24:25 +03:00
|
|
|
bool isSocialTrackingResource,
|
2018-07-10 11:09:59 +03:00
|
|
|
bool firstPartyStorageAccessGranted,
|
2019-05-25 04:25:41 +03:00
|
|
|
uint32_t rejectedReason,
|
2018-04-08 20:52:05 +03:00
|
|
|
bool isSafeTopLevelNav,
|
2018-04-12 13:52:51 +03:00
|
|
|
bool isSameSiteForeign,
|
2017-08-03 14:00:41 +03:00
|
|
|
OriginAttributes attrs);
|
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async __delete__();
|
2017-08-03 14:00:41 +03:00
|
|
|
|
|
|
|
child:
|
|
|
|
async TrackCookiesLoad(CookieStruct[] cookiesList,
|
|
|
|
OriginAttributes attrs);
|
2017-08-03 13:00:12 +03:00
|
|
|
|
|
|
|
async RemoveCookie(CookieStruct cookie,
|
|
|
|
OriginAttributes attrs);
|
|
|
|
|
|
|
|
async RemoveBatchDeletedCookies(CookieStruct[] cookiesList,
|
|
|
|
OriginAttributes[] attrsList);
|
|
|
|
|
|
|
|
async RemoveAll();
|
|
|
|
|
|
|
|
async AddCookie(CookieStruct cookie,
|
|
|
|
OriginAttributes attrs);
|
|
|
|
|
2010-03-26 02:02:28 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|