Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */ |
michael@0 | 3 | |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | include protocol PNecko; |
michael@0 | 9 | include URIParams; |
michael@0 | 10 | |
michael@0 | 11 | |
michael@0 | 12 | using class IPC::SerializedLoadContext from "SerializedLoadContext.h"; |
michael@0 | 13 | |
michael@0 | 14 | namespace mozilla { |
michael@0 | 15 | namespace net { |
michael@0 | 16 | |
michael@0 | 17 | /** |
michael@0 | 18 | * PCookieService |
michael@0 | 19 | * |
michael@0 | 20 | * Provides IPDL methods for setting and getting cookies. These are stored on |
michael@0 | 21 | * and managed by the parent; the child process goes through the parent for |
michael@0 | 22 | * all cookie operations. Lower-level programmatic operations (i.e. those |
michael@0 | 23 | * provided by the nsICookieManager and nsICookieManager2 interfaces) are not |
michael@0 | 24 | * currently implemented and requesting these interfaces in the child will fail. |
michael@0 | 25 | * |
michael@0 | 26 | * @see nsICookieService |
michael@0 | 27 | * @see nsICookiePermission |
michael@0 | 28 | */ |
michael@0 | 29 | |
michael@0 | 30 | sync protocol PCookieService |
michael@0 | 31 | { |
michael@0 | 32 | manager PNecko; |
michael@0 | 33 | |
michael@0 | 34 | parent: |
michael@0 | 35 | |
michael@0 | 36 | /* |
michael@0 | 37 | * Get the complete cookie string associated with the URI. This is a sync |
michael@0 | 38 | * call in order to avoid race conditions -- for instance, an HTTP response |
michael@0 | 39 | * on the parent and script access on the child. |
michael@0 | 40 | * |
michael@0 | 41 | * @param host |
michael@0 | 42 | * Same as the 'aURI' argument to nsICookieService.getCookieString. |
michael@0 | 43 | * @param isForeign |
michael@0 | 44 | * True if the the request is third party, for purposes of allowing |
michael@0 | 45 | * access to cookies. This should be obtained from |
michael@0 | 46 | * mozIThirdPartyUtil.isThirdPartyChannel. Third party requests may be |
michael@0 | 47 | * rejected depending on user preferences; if those checks are |
michael@0 | 48 | * disabled, this parameter is ignored. |
michael@0 | 49 | * @param fromHttp |
michael@0 | 50 | * Whether the result is for an HTTP request header. This should be |
michael@0 | 51 | * true for nsICookieService.getCookieStringFromHttp calls, false |
michael@0 | 52 | * otherwise. |
michael@0 | 53 | * @param loadContext |
michael@0 | 54 | * The loadContext from the HTTP channel or document that the cookie is |
michael@0 | 55 | * being set on. |
michael@0 | 56 | * |
michael@0 | 57 | * @see nsICookieService.getCookieString |
michael@0 | 58 | * @see nsICookieService.getCookieStringFromHttp |
michael@0 | 59 | * @see mozIThirdPartyUtil.isThirdPartyChannel |
michael@0 | 60 | * |
michael@0 | 61 | * @return the resulting cookie string. |
michael@0 | 62 | */ |
michael@0 | 63 | sync GetCookieString(URIParams host, |
michael@0 | 64 | bool isForeign, |
michael@0 | 65 | bool fromHttp, |
michael@0 | 66 | SerializedLoadContext loadContext) |
michael@0 | 67 | returns (nsCString result); |
michael@0 | 68 | |
michael@0 | 69 | /* |
michael@0 | 70 | * Set a cookie string. |
michael@0 | 71 | * |
michael@0 | 72 | * @param host |
michael@0 | 73 | * Same as the 'aURI' argument to nsICookieService.setCookieString. |
michael@0 | 74 | * @param isForeign |
michael@0 | 75 | * True if the the request is third party, for purposes of allowing |
michael@0 | 76 | * access to cookies. This should be obtained from |
michael@0 | 77 | * mozIThirdPartyUtil.isThirdPartyChannel. Third party requests may be |
michael@0 | 78 | * rejected depending on user preferences; if those checks are |
michael@0 | 79 | * disabled, this parameter is ignored. |
michael@0 | 80 | * @param cookieString |
michael@0 | 81 | * Same as the 'aCookie' argument to nsICookieService.setCookieString. |
michael@0 | 82 | * @param serverTime |
michael@0 | 83 | * Same as the 'aServerTime' argument to |
michael@0 | 84 | * nsICookieService.setCookieStringFromHttp. If the string is empty or |
michael@0 | 85 | * null (e.g. for non-HTTP requests), the current local time is used. |
michael@0 | 86 | * @param fromHttp |
michael@0 | 87 | * Whether the result is for an HTTP request header. This should be |
michael@0 | 88 | * true for nsICookieService.setCookieStringFromHttp calls, false |
michael@0 | 89 | * otherwise. |
michael@0 | 90 | * @param loadContext |
michael@0 | 91 | * The loadContext from the HTTP channel or document that the cookie is |
michael@0 | 92 | * being set on. |
michael@0 | 93 | * |
michael@0 | 94 | * @see nsICookieService.setCookieString |
michael@0 | 95 | * @see nsICookieService.setCookieStringFromHttp |
michael@0 | 96 | * @see mozIThirdPartyUtil.isThirdPartyChannel |
michael@0 | 97 | */ |
michael@0 | 98 | SetCookieString(URIParams host, |
michael@0 | 99 | bool isForeign, |
michael@0 | 100 | nsCString cookieString, |
michael@0 | 101 | nsCString serverTime, |
michael@0 | 102 | bool fromHttp, |
michael@0 | 103 | SerializedLoadContext loadContext); |
michael@0 | 104 | |
michael@0 | 105 | __delete__(); |
michael@0 | 106 | }; |
michael@0 | 107 | |
michael@0 | 108 | } |
michael@0 | 109 | } |
michael@0 | 110 |