Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
7 #include "nsIRDFDataSource.idl"
8 #include "nsIRDFResource.idl"
9 #include "nsIRDFNode.idl"
10 #include "nsISimpleEnumerator.idl"
12 // A wrapper for manipulating RDF containers
13 [scriptable, uuid(D4214E90-FB94-11D2-BDD8-00104BDE6048)]
14 interface nsIRDFContainer : nsISupports {
15 readonly attribute nsIRDFDataSource DataSource;
16 readonly attribute nsIRDFResource Resource;
18 /**
19 * Initialize the container wrapper to the specified resource
20 * using the specified datasource for context.
21 */
22 void Init(in nsIRDFDataSource aDataSource, in nsIRDFResource aContainer);
24 /**
25 * Return the number of elements in the container. Note that this
26 * may not always be accurate due to aggregation.
27 */
28 long GetCount();
30 /**
31 * Return an enumerator that can be used to enumerate the contents
32 * of the container in ascending order.
33 */
34 nsISimpleEnumerator GetElements();
36 /**
37 * Append an element to the container, assigning it the next
38 * available ordinal.
39 */
40 void AppendElement(in nsIRDFNode aElement);
42 /**
43 * Remove the first occurence of the specified element from the
44 * container. If aRenumber is 'true', then the underlying RDF graph
45 * will be 're-numbered' to account for the removal.
46 */
47 void RemoveElement(in nsIRDFNode aElement, in boolean aRenumber);
49 /**
50 * Insert aElement at the specified index. If aRenumber is 'true', then
51 * the underlying RDF graph will be 're-numbered' to accomodate the new
52 * element.
53 */
54 void InsertElementAt(in nsIRDFNode aElement, in long aIndex, in boolean aRenumber);
56 /**
57 * Remove the element at the specified index. If aRenumber is 'true', then
58 * the underlying RDF graph will be 're-numbered' to account for the
59 * removal.
60 *
61 * @return the element that was removed.
62 */
63 nsIRDFNode RemoveElementAt(in long aIndex, in boolean aRenumber);
65 /**
66 * Determine the index of an element in the container.
67 *
68 * @return The index of the specified element in the container. If
69 * the element is not contained in the container, this function
70 * returns '-1'.
71 */
72 long IndexOf(in nsIRDFNode aElement);
73 };
75 %{C++
76 nsresult
77 NS_NewRDFContainer(nsIRDFContainer** aResult);
79 nsresult
80 NS_NewRDFContainer(nsIRDFDataSource* aDataSource,
81 nsIRDFResource* aResource,
82 nsIRDFContainer** aResult);
84 /**
85 * Create a cursor on a container that enumerates its contents in
86 * order
87 */
88 nsresult
89 NS_NewContainerEnumerator(nsIRDFDataSource* aDataSource,
90 nsIRDFResource* aContainer,
91 nsISimpleEnumerator** aResult);
94 %}