Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / netwerk / cookie / public / nsICookieService.idl
blob3b109b0fdf4a7d2036868b51f695121aa6ad714d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsISupports.idl"
40 interface nsIURI;
41 interface nsIPrompt;
42 interface nsIChannel;
44 /**
45 * nsICookieService
47 * Provides methods for setting and getting cookies in the context of a
48 * page load. See nsICookieManager for methods to manipulate the cookie
49 * database directly. This separation of interface is mainly historical.
51 * This service broadcasts the following notifications when the cookie
52 * list is changed, or a cookie is rejected:
54 * topic : "cookie-changed"
55 * broadcast whenever the cookie list changes in some way. there
56 * are four possible data strings for this notification; one
57 * notification will be broadcast for each change, and will involve
58 * a single cookie.
59 * subject: an nsICookie2 interface pointer representing the cookie object
60 * that changed.
61 * data : "deleted"
62 * a cookie was deleted. the subject is the deleted cookie.
63 * "added"
64 * a cookie was added. the subject is the added cookie.
65 * "changed"
66 * a cookie was changed. the subject is the new cookie.
67 * "cleared"
68 * the entire cookie list was cleared. the subject is null.
69 * "reload"
70 * the entire cookie list should be reloaded. the subject is null.
72 * topic : "cookie-rejected"
73 * broadcast whenever a cookie was rejected from being set as a
74 * result of user prefs.
75 * subject: an nsIURI interface pointer representing the URI that attempted
76 * to set the cookie.
77 * data : none.
79 [scriptable, uuid(2aaa897a-293c-4d2b-a657-8c9b7136996d)]
80 interface nsICookieService : nsISupports
83 * Get the complete cookie string associated with the URI.
85 * @param aURI
86 * the URI of the document for which cookies are being queried.
87 * @param aChannel
88 * the channel used to load the document. this parameter may be null,
89 * but it is strongly recommended that a non-null value be provided to
90 * ensure that the cookie privacy preferences are honored.
92 * @return the resulting cookie string
94 string getCookieString(in nsIURI aURI, in nsIChannel aChannel);
97 * Get the complete cookie string associated with the URI.
99 * This function is NOT redundant with getCookieString, as the result
100 * will be different based on httponly (see bug 178993)
102 * @param aURI
103 * the URI of the document for which cookies are being queried.
104 * @param aFirstURI
105 * the URI that the user originally typed in or clicked on to initiate
106 * the load of the document referenced by aURI.
107 * @param aChannel
108 * the channel used to load the document. this parameter may be null,
109 * but it is strongly recommended that a non-null value be provided to
110 * ensure that the cookie privacy preferences are honored.
112 * @return the resulting cookie string
114 string getCookieStringFromHttp(in nsIURI aURI, in nsIURI aFirstURI, in nsIChannel aChannel);
117 * Set the cookie string associated with the URI.
119 * @param aURI
120 * the URI of the document for which cookies are being set.
121 * @param aPrompt
122 * the prompt to use for all user-level cookie notifications.
123 * @param aCookie
124 * the cookie string to set.
125 * @param aChannel
126 * the channel used to load the document. this parameter may be null,
127 * but it is strongly recommended that a non-null value be provided to
128 * ensure that the cookie privacy preferences are honored.
130 * XXX should be able to allow null aPrompt, since nsIPrompt can be queryied
131 * from aChannel.
133 void setCookieString(in nsIURI aURI, in nsIPrompt aPrompt, in string aCookie, in nsIChannel aChannel);
136 * Set the cookie string and expires associated with the URI.
138 * This function is NOT redundant with setCookieString, as the result
139 * will be different based on httponly (see bug 178993)
141 * @param aURI
142 * the URI of the document for which cookies are being set.
143 * @param aFirstURI
144 * the URI that the user originally typed in or clicked on to initiate
145 * the load of the document referenced by aURI.
146 * @param aPrompt
147 * the prompt to use for all user-level cookie notifications.
148 * @param aCookie
149 * the cookie string to set.
150 * @param aServerTime
151 * the expiry information of the cookie (the Date header from the HTTP
152 * response).
153 * @param aChannel
154 * the channel used to load the document. this parameter may be null,
155 * but it is strongly recommended that a non-null value be provided to
156 * ensure that the cookie privacy preferences are honored.
158 void setCookieStringFromHttp(in nsIURI aURI, in nsIURI aFirstURI, in nsIPrompt aPrompt, in string aCookie, in string aServerTime, in nsIChannel aChannel);