netwerk/cookie/PCookieService.ipdl

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

mercurial