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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | #include "nsISupportsArray.idl" |
michael@0 | 8 | #include "nsIRDFResource.idl" |
michael@0 | 9 | #include "nsIRDFNode.idl" |
michael@0 | 10 | #include "nsISimpleEnumerator.idl" |
michael@0 | 11 | #include "nsIRDFObserver.idl" |
michael@0 | 12 | |
michael@0 | 13 | [scriptable, uuid(0F78DA58-8321-11d2-8EAC-00805F29F370)] |
michael@0 | 14 | interface nsIRDFDataSource : nsISupports |
michael@0 | 15 | { |
michael@0 | 16 | /** The "URI" of the data source. This used by the RDF service's |
michael@0 | 17 | * |GetDataSource()| method to cache datasources. |
michael@0 | 18 | */ |
michael@0 | 19 | readonly attribute string URI; |
michael@0 | 20 | |
michael@0 | 21 | /** Find an RDF resource that points to a given node over the |
michael@0 | 22 | * specified arc & truth value |
michael@0 | 23 | * |
michael@0 | 24 | * @throws NS_RDF_NO_VALUE if there is no source that leads |
michael@0 | 25 | * to the target with the specified property. |
michael@0 | 26 | */ |
michael@0 | 27 | nsIRDFResource GetSource(in nsIRDFResource aProperty, |
michael@0 | 28 | in nsIRDFNode aTarget, |
michael@0 | 29 | in boolean aTruthValue); |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * Find all RDF resources that point to a given node over the |
michael@0 | 33 | * specified arc & truth value |
michael@0 | 34 | */ |
michael@0 | 35 | nsISimpleEnumerator GetSources(in nsIRDFResource aProperty, |
michael@0 | 36 | in nsIRDFNode aTarget, |
michael@0 | 37 | in boolean aTruthValue); |
michael@0 | 38 | |
michael@0 | 39 | /** |
michael@0 | 40 | * Find a child of that is related to the source by the given arc |
michael@0 | 41 | * arc and truth value |
michael@0 | 42 | * |
michael@0 | 43 | * @throws NS_RDF_NO_VALUE if there is no target accessible from the |
michael@0 | 44 | * source via the specified property. |
michael@0 | 45 | */ |
michael@0 | 46 | nsIRDFNode GetTarget(in nsIRDFResource aSource, |
michael@0 | 47 | in nsIRDFResource aProperty, |
michael@0 | 48 | in boolean aTruthValue); |
michael@0 | 49 | |
michael@0 | 50 | /** |
michael@0 | 51 | * Find all children of that are related to the source by the given arc |
michael@0 | 52 | * arc and truth value. |
michael@0 | 53 | */ |
michael@0 | 54 | nsISimpleEnumerator GetTargets(in nsIRDFResource aSource, |
michael@0 | 55 | in nsIRDFResource aProperty, |
michael@0 | 56 | in boolean aTruthValue); |
michael@0 | 57 | |
michael@0 | 58 | /** |
michael@0 | 59 | * Add an assertion to the graph. |
michael@0 | 60 | */ |
michael@0 | 61 | void Assert(in nsIRDFResource aSource, |
michael@0 | 62 | in nsIRDFResource aProperty, |
michael@0 | 63 | in nsIRDFNode aTarget, |
michael@0 | 64 | in boolean aTruthValue); |
michael@0 | 65 | |
michael@0 | 66 | /** |
michael@0 | 67 | * Remove an assertion from the graph. |
michael@0 | 68 | */ |
michael@0 | 69 | void Unassert(in nsIRDFResource aSource, |
michael@0 | 70 | in nsIRDFResource aProperty, |
michael@0 | 71 | in nsIRDFNode aTarget); |
michael@0 | 72 | |
michael@0 | 73 | /** |
michael@0 | 74 | * Change an assertion from |
michael@0 | 75 | * |
michael@0 | 76 | * [aSource]--[aProperty]-->[aOldTarget] |
michael@0 | 77 | * |
michael@0 | 78 | * to |
michael@0 | 79 | * |
michael@0 | 80 | * [aSource]--[aProperty]-->[aNewTarget] |
michael@0 | 81 | */ |
michael@0 | 82 | void Change(in nsIRDFResource aSource, |
michael@0 | 83 | in nsIRDFResource aProperty, |
michael@0 | 84 | in nsIRDFNode aOldTarget, |
michael@0 | 85 | in nsIRDFNode aNewTarget); |
michael@0 | 86 | |
michael@0 | 87 | /** |
michael@0 | 88 | * 'Move' an assertion from |
michael@0 | 89 | * |
michael@0 | 90 | * [aOldSource]--[aProperty]-->[aTarget] |
michael@0 | 91 | * |
michael@0 | 92 | * to |
michael@0 | 93 | * |
michael@0 | 94 | * [aNewSource]--[aProperty]-->[aTarget] |
michael@0 | 95 | */ |
michael@0 | 96 | void Move(in nsIRDFResource aOldSource, |
michael@0 | 97 | in nsIRDFResource aNewSource, |
michael@0 | 98 | in nsIRDFResource aProperty, |
michael@0 | 99 | in nsIRDFNode aTarget); |
michael@0 | 100 | |
michael@0 | 101 | /** |
michael@0 | 102 | * Query whether an assertion exists in this graph. |
michael@0 | 103 | */ |
michael@0 | 104 | boolean HasAssertion(in nsIRDFResource aSource, |
michael@0 | 105 | in nsIRDFResource aProperty, |
michael@0 | 106 | in nsIRDFNode aTarget, |
michael@0 | 107 | in boolean aTruthValue); |
michael@0 | 108 | |
michael@0 | 109 | /** |
michael@0 | 110 | * Add an observer to this data source. If the datasource |
michael@0 | 111 | * supports observers, the datasource source should hold a strong |
michael@0 | 112 | * reference to the observer. |
michael@0 | 113 | */ |
michael@0 | 114 | void AddObserver(in nsIRDFObserver aObserver); |
michael@0 | 115 | |
michael@0 | 116 | /** |
michael@0 | 117 | * Remove an observer from this data source. |
michael@0 | 118 | */ |
michael@0 | 119 | void RemoveObserver(in nsIRDFObserver aObserver); |
michael@0 | 120 | |
michael@0 | 121 | /** |
michael@0 | 122 | * Get a cursor to iterate over all the arcs that point into a node. |
michael@0 | 123 | */ |
michael@0 | 124 | nsISimpleEnumerator ArcLabelsIn(in nsIRDFNode aNode); |
michael@0 | 125 | |
michael@0 | 126 | /** |
michael@0 | 127 | * Get a cursor to iterate over all the arcs that originate in |
michael@0 | 128 | * a resource. |
michael@0 | 129 | */ |
michael@0 | 130 | nsISimpleEnumerator ArcLabelsOut(in nsIRDFResource aSource); |
michael@0 | 131 | |
michael@0 | 132 | /** |
michael@0 | 133 | * Retrieve all of the resources that the data source currently |
michael@0 | 134 | * refers to. |
michael@0 | 135 | */ |
michael@0 | 136 | nsISimpleEnumerator GetAllResources(); |
michael@0 | 137 | |
michael@0 | 138 | /** |
michael@0 | 139 | * Returns whether a given command is enabled for a set of sources. |
michael@0 | 140 | */ |
michael@0 | 141 | boolean IsCommandEnabled(in nsISupportsArray aSources, |
michael@0 | 142 | in nsIRDFResource aCommand, |
michael@0 | 143 | in nsISupportsArray aArguments); |
michael@0 | 144 | |
michael@0 | 145 | /** |
michael@0 | 146 | * Perform the specified command on set of sources. |
michael@0 | 147 | */ |
michael@0 | 148 | void DoCommand(in nsISupportsArray aSources, |
michael@0 | 149 | in nsIRDFResource aCommand, |
michael@0 | 150 | in nsISupportsArray aArguments); |
michael@0 | 151 | |
michael@0 | 152 | /** |
michael@0 | 153 | * Returns the set of all commands defined for a given source. |
michael@0 | 154 | */ |
michael@0 | 155 | nsISimpleEnumerator GetAllCmds(in nsIRDFResource aSource); |
michael@0 | 156 | |
michael@0 | 157 | /** |
michael@0 | 158 | * Returns true if the specified node is pointed to by the specified arc. |
michael@0 | 159 | * Equivalent to enumerating ArcLabelsIn and comparing for the specified arc. |
michael@0 | 160 | */ |
michael@0 | 161 | boolean hasArcIn(in nsIRDFNode aNode, in nsIRDFResource aArc); |
michael@0 | 162 | |
michael@0 | 163 | /** |
michael@0 | 164 | * Returns true if the specified node has the specified outward arc. |
michael@0 | 165 | * Equivalent to enumerating ArcLabelsOut and comparing for the specified arc. |
michael@0 | 166 | */ |
michael@0 | 167 | boolean hasArcOut(in nsIRDFResource aSource, in nsIRDFResource aArc); |
michael@0 | 168 | |
michael@0 | 169 | /** |
michael@0 | 170 | * Notify observers that the datasource is about to send several |
michael@0 | 171 | * notifications at once. |
michael@0 | 172 | * This must be followed by calling endUpdateBatch(), otherwise |
michael@0 | 173 | * viewers will get out of sync. |
michael@0 | 174 | */ |
michael@0 | 175 | void beginUpdateBatch(); |
michael@0 | 176 | |
michael@0 | 177 | /** |
michael@0 | 178 | * Notify observers that the datasource has completed issuing |
michael@0 | 179 | * a notification group. |
michael@0 | 180 | */ |
michael@0 | 181 | void endUpdateBatch(); |
michael@0 | 182 | }; |