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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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"
8 interface nsIAtom;
9 interface nsIDOMNode;
10 interface nsIRDFResource;
12 /**
13 * A single result generated from a template query. Each result is identified
14 * by an id, which must be unique within the set of results produced from a
15 * query. The result may optionally be identified by an RDF resource.
16 *
17 * Generally, the result and its id will be able to uniquely identify a node
18 * in the source data, such as an RDF or XML node. In other contexts, such as
19 * a database query, a result would represent a particular record.
20 *
21 * A result is expected to only be created by a query processor.
22 *
23 * Each result also contains a set of variable bindings. The value for a
24 * particular variable may be retrieved using the getBindingFor and
25 * getBindingObjectFor methods.
26 */
27 [scriptable, uuid(ebea0230-36fa-41b7-8e31-760806057965)]
28 interface nsIXULTemplateResult : nsISupports
29 {
30 /**
31 * True if the result represents a container.
32 */
33 readonly attribute boolean isContainer;
35 /**
36 * True if the result represents an empty container.
37 */
38 readonly attribute boolean isEmpty;
40 /**
41 * True if the template builder may use this result as the reference point
42 * for additional recursive processing of the template. The template builder
43 * will reprocess the template using this result as the reference point and
44 * generate output content that is expected to be inserted as children of the
45 * output generated for this result. If false, child content is not
46 * processed. This property identifies only the default handling and may be
47 * overriden by syntax used in the template.
48 */
49 readonly attribute boolean mayProcessChildren;
51 /**
52 * ID of the result. The DOM element created for this result, if any, will
53 * have its id attribute set to this value. The id must be unique for a
54 * query.
55 */
56 readonly attribute AString id;
58 /**
59 * Resource for the result, which may be null. If set, the resource uri
60 * must be the same as the ID property.
61 */
62 readonly attribute nsIRDFResource resource;
64 /**
65 * The type of the object. The predefined value 'separator' may be used
66 * for separators. Other values may be used for application specific
67 * purposes.
68 */
69 readonly attribute AString type;
71 /**
72 * Get the string representation of the value of a variable for this
73 * result. This string will be used in the action body from a template as
74 * the replacement text. For instance, if the text ?name appears in an
75 * attribute within the action body, it will be replaced with the result
76 * of this method. The question mark is considered part of the variable
77 * name, thus aVar should be ?name and not simply name.
78 *
79 * @param aVar the variable to look up
80 *
81 * @return the value for the variable or a null string if it has no value
82 */
83 AString getBindingFor(in nsIAtom aVar);
85 /**
86 * Get an object value for a variable such as ?name for this result.
87 *
88 * This method may return null for a variable, even if getBindingFor returns
89 * a non-null value for the same variable. This method is provided as a
90 * convenience when sorting results.
91 *
92 * @param aVar the variable to look up
93 *
94 * @return the value for the variable or null if it has no value
95 */
96 nsISupports getBindingObjectFor(in nsIAtom aVar);
98 /**
99 * Indicate that a particular rule of a query has matched and that output
100 * will be generated for it. Both the query as compiled by the query
101 * processor's compileQuery method and the XUL <rule> element are supplied.
102 * The query must always be one that was compiled by the query processor
103 * that created this result. The <rule> element must always be a child of
104 * the <query> element that was used to compile the query.
105 *
106 * @param aQuery the query that matched
107 * @param aRuleNode the rule node that matched
108 */
109 void ruleMatched(in nsISupports aQuery, in nsIDOMNode aRuleNode);
111 /**
112 * Indicate that the output for a result has beeen removed and that the
113 * result is no longer being used by the builder.
114 */
115 void hasBeenRemoved();
116 };