toolkit/components/places/mozIAsyncHistory.idl

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #include "nsISupports.idl"
michael@0 6
michael@0 7 interface nsIURI;
michael@0 8 interface nsIVariant;
michael@0 9
michael@0 10 [scriptable, uuid(41e4ccc9-f0c8-4cd7-9753-7a38514b8488)]
michael@0 11 interface mozIVisitInfo : nsISupports
michael@0 12 {
michael@0 13 /**
michael@0 14 * The machine-local (internal) id of the visit.
michael@0 15 */
michael@0 16 readonly attribute long long visitId;
michael@0 17
michael@0 18 /**
michael@0 19 * The time the visit occurred.
michael@0 20 */
michael@0 21 readonly attribute PRTime visitDate;
michael@0 22
michael@0 23 /**
michael@0 24 * The transition type used to get to this visit. One of the TRANSITION_TYPE
michael@0 25 * constants on nsINavHistory.
michael@0 26 *
michael@0 27 * @see nsINavHistory.idl
michael@0 28 */
michael@0 29 readonly attribute unsigned long transitionType;
michael@0 30
michael@0 31 /**
michael@0 32 * The referring URI of this visit. This may be null.
michael@0 33 */
michael@0 34 readonly attribute nsIURI referrerURI;
michael@0 35 };
michael@0 36
michael@0 37 [scriptable, uuid(ad83e137-c92a-4b7b-b67e-0a318811f91e)]
michael@0 38 interface mozIPlaceInfo : nsISupports
michael@0 39 {
michael@0 40 /**
michael@0 41 * The machine-local (internal) id of the place.
michael@0 42 */
michael@0 43 readonly attribute long long placeId;
michael@0 44
michael@0 45 /**
michael@0 46 * The globally unique id of the place.
michael@0 47 */
michael@0 48 readonly attribute ACString guid;
michael@0 49
michael@0 50 /**
michael@0 51 * The URI of the place.
michael@0 52 */
michael@0 53 readonly attribute nsIURI uri;
michael@0 54
michael@0 55 /**
michael@0 56 * The title associated with the place.
michael@0 57 */
michael@0 58 readonly attribute AString title;
michael@0 59
michael@0 60 /**
michael@0 61 * The frecency of the place.
michael@0 62 */
michael@0 63 readonly attribute long long frecency;
michael@0 64
michael@0 65 /**
michael@0 66 * An array of mozIVisitInfo objects for the place.
michael@0 67 */
michael@0 68 [implicit_jscontext]
michael@0 69 readonly attribute jsval visits;
michael@0 70 };
michael@0 71
michael@0 72 /**
michael@0 73 * Shared Callback interface for mozIAsyncHistory methods. The semantics
michael@0 74 * for each method are detailed in mozIAsyncHistory.
michael@0 75 */
michael@0 76 [scriptable, uuid(1f266877-2859-418b-a11b-ec3ae4f4f93d)]
michael@0 77 interface mozIVisitInfoCallback : nsISupports
michael@0 78 {
michael@0 79 /**
michael@0 80 * Called when the given place could not be processed.
michael@0 81 *
michael@0 82 * @param aResultCode
michael@0 83 * nsresult indicating the failure reason.
michael@0 84 * @param aPlaceInfo
michael@0 85 * The information that was given to the caller for the place.
michael@0 86 */
michael@0 87 void handleError(in nsresult aResultCode,
michael@0 88 in mozIPlaceInfo aPlaceInfo);
michael@0 89
michael@0 90 /**
michael@0 91 * Called for each place processed successfully.
michael@0 92 *
michael@0 93 * @param aPlaceInfo
michael@0 94 * The current info stored for the place.
michael@0 95 */
michael@0 96 void handleResult(in mozIPlaceInfo aPlaceInfo);
michael@0 97
michael@0 98 /**
michael@0 99 * Called when all records were processed.
michael@0 100 */
michael@0 101 void handleCompletion();
michael@0 102
michael@0 103 };
michael@0 104
michael@0 105 [scriptable, function, uuid(994092bf-936f-449b-8dd6-0941e024360d)]
michael@0 106 interface mozIVisitedStatusCallback : nsISupports
michael@0 107 {
michael@0 108 /**
michael@0 109 * Notifies whether a certain URI has been visited.
michael@0 110 *
michael@0 111 * @param aURI
michael@0 112 * URI being notified about.
michael@0 113 * @param aVisitedStatus
michael@0 114 * The visited status of aURI.
michael@0 115 */
michael@0 116 void isVisited(in nsIURI aURI,
michael@0 117 in boolean aVisitedStatus);
michael@0 118 };
michael@0 119
michael@0 120 [scriptable, uuid(1643EFD2-A329-4733-A39D-17069C8D3B2D)]
michael@0 121 interface mozIAsyncHistory : nsISupports
michael@0 122 {
michael@0 123 /**
michael@0 124 * Gets the available information for the given array of places, each
michael@0 125 * identified by either nsIURI or places GUID (string).
michael@0 126 *
michael@0 127 * The retrieved places info objects DO NOT include the visits data (the
michael@0 128 * |visits| attribute is set to null).
michael@0 129 *
michael@0 130 * If a given place does not exist in the database, aCallback.handleError is
michael@0 131 * called for it with NS_ERROR_NOT_AVAILABLE result code.
michael@0 132 *
michael@0 133 * @param aPlaceIdentifiers
michael@0 134 * The place[s] for which to retrieve information, identified by either
michael@0 135 * a single place GUID, a single URI, or a JS array of URIs and/or GUIDs.
michael@0 136 * @param aCallback
michael@0 137 * A mozIVisitInfoCallback object which consists of callbacks to be
michael@0 138 * notified for successful or failed retrievals.
michael@0 139 * If there's no information available for a given place, aCallback
michael@0 140 * is called with a stub place info object, containing just the provided
michael@0 141 * data (GUID or URI).
michael@0 142 *
michael@0 143 * @throws NS_ERROR_INVALID_ARG
michael@0 144 * - Passing in NULL for aPlaceIdentifiers or aCallback.
michael@0 145 * - Not providing at least one valid GUID or URI.
michael@0 146 */
michael@0 147 [implicit_jscontext]
michael@0 148 void getPlacesInfo(in jsval aPlaceIdentifiers,
michael@0 149 in mozIVisitInfoCallback aCallback);
michael@0 150
michael@0 151 /**
michael@0 152 * Adds a set of visits for one or more mozIPlaceInfo objects, and updates
michael@0 153 * each mozIPlaceInfo's title or guid.
michael@0 154 *
michael@0 155 * aCallback.handleResult is called for each visit added.
michael@0 156 *
michael@0 157 * @param aPlaceInfo
michael@0 158 * The mozIPlaceInfo object[s] containing the information to store or
michael@0 159 * update. This can be a single object, or an array of objects.
michael@0 160 * @param [optional] aCallback
michael@0 161 * A mozIVisitInfoCallback object which consists of callbacks to be
michael@0 162 * notified for successful and/or failed changes.
michael@0 163 *
michael@0 164 * @throws NS_ERROR_INVALID_ARG
michael@0 165 * - Passing in NULL for aPlaceInfo.
michael@0 166 * - Not providing at least one valid guid, or uri for all
michael@0 167 * mozIPlaceInfo object[s].
michael@0 168 * - Not providing an array or nothing for the visits property of
michael@0 169 * mozIPlaceInfo.
michael@0 170 * - Not providing a visitDate and transitionType for each
michael@0 171 * mozIVisitInfo.
michael@0 172 * - Providing an invalid transitionType for a mozIVisitInfo.
michael@0 173 */
michael@0 174 [implicit_jscontext]
michael@0 175 void updatePlaces(in jsval aPlaceInfo,
michael@0 176 [optional] in mozIVisitInfoCallback aCallback);
michael@0 177
michael@0 178 /**
michael@0 179 * Checks if a given URI has been visited.
michael@0 180 *
michael@0 181 * @param aURI
michael@0 182 * The URI to check for.
michael@0 183 * @param aCallback
michael@0 184 * A mozIVisitStatusCallback object which receives the visited status.
michael@0 185 */
michael@0 186 void isURIVisited(in nsIURI aURI,
michael@0 187 in mozIVisitedStatusCallback aCallback);
michael@0 188 };

mercurial