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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef nsPlacesIndexes_h__ |
michael@0 | 8 | #define nsPlacesIndexes_h__ |
michael@0 | 9 | |
michael@0 | 10 | #define CREATE_PLACES_IDX(__name, __table, __columns, __type) \ |
michael@0 | 11 | NS_LITERAL_CSTRING( \ |
michael@0 | 12 | "CREATE " __type " INDEX IF NOT EXISTS " __table "_" __name \ |
michael@0 | 13 | " ON " __table " (" __columns ")" \ |
michael@0 | 14 | ) |
michael@0 | 15 | |
michael@0 | 16 | /** |
michael@0 | 17 | * moz_places |
michael@0 | 18 | */ |
michael@0 | 19 | #define CREATE_IDX_MOZ_PLACES_URL \ |
michael@0 | 20 | CREATE_PLACES_IDX( \ |
michael@0 | 21 | "url_uniqueindex", "moz_places", "url", "UNIQUE" \ |
michael@0 | 22 | ) |
michael@0 | 23 | |
michael@0 | 24 | #define CREATE_IDX_MOZ_PLACES_FAVICON \ |
michael@0 | 25 | CREATE_PLACES_IDX( \ |
michael@0 | 26 | "faviconindex", "moz_places", "favicon_id", "" \ |
michael@0 | 27 | ) |
michael@0 | 28 | |
michael@0 | 29 | #define CREATE_IDX_MOZ_PLACES_REVHOST \ |
michael@0 | 30 | CREATE_PLACES_IDX( \ |
michael@0 | 31 | "hostindex", "moz_places", "rev_host", "" \ |
michael@0 | 32 | ) |
michael@0 | 33 | |
michael@0 | 34 | #define CREATE_IDX_MOZ_PLACES_VISITCOUNT \ |
michael@0 | 35 | CREATE_PLACES_IDX( \ |
michael@0 | 36 | "visitcount", "moz_places", "visit_count", "" \ |
michael@0 | 37 | ) |
michael@0 | 38 | |
michael@0 | 39 | #define CREATE_IDX_MOZ_PLACES_FRECENCY \ |
michael@0 | 40 | CREATE_PLACES_IDX( \ |
michael@0 | 41 | "frecencyindex", "moz_places", "frecency", "" \ |
michael@0 | 42 | ) |
michael@0 | 43 | |
michael@0 | 44 | #define CREATE_IDX_MOZ_PLACES_LASTVISITDATE \ |
michael@0 | 45 | CREATE_PLACES_IDX( \ |
michael@0 | 46 | "lastvisitdateindex", "moz_places", "last_visit_date", "" \ |
michael@0 | 47 | ) |
michael@0 | 48 | |
michael@0 | 49 | #define CREATE_IDX_MOZ_PLACES_GUID \ |
michael@0 | 50 | CREATE_PLACES_IDX( \ |
michael@0 | 51 | "guid_uniqueindex", "moz_places", "guid", "UNIQUE" \ |
michael@0 | 52 | ) |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * moz_historyvisits |
michael@0 | 56 | */ |
michael@0 | 57 | |
michael@0 | 58 | #define CREATE_IDX_MOZ_HISTORYVISITS_PLACEDATE \ |
michael@0 | 59 | CREATE_PLACES_IDX( \ |
michael@0 | 60 | "placedateindex", "moz_historyvisits", "place_id, visit_date", "" \ |
michael@0 | 61 | ) |
michael@0 | 62 | |
michael@0 | 63 | #define CREATE_IDX_MOZ_HISTORYVISITS_FROMVISIT \ |
michael@0 | 64 | CREATE_PLACES_IDX( \ |
michael@0 | 65 | "fromindex", "moz_historyvisits", "from_visit", "" \ |
michael@0 | 66 | ) |
michael@0 | 67 | |
michael@0 | 68 | #define CREATE_IDX_MOZ_HISTORYVISITS_VISITDATE \ |
michael@0 | 69 | CREATE_PLACES_IDX( \ |
michael@0 | 70 | "dateindex", "moz_historyvisits", "visit_date", "" \ |
michael@0 | 71 | ) |
michael@0 | 72 | |
michael@0 | 73 | /** |
michael@0 | 74 | * moz_bookmarks |
michael@0 | 75 | */ |
michael@0 | 76 | |
michael@0 | 77 | #define CREATE_IDX_MOZ_BOOKMARKS_PLACETYPE \ |
michael@0 | 78 | CREATE_PLACES_IDX( \ |
michael@0 | 79 | "itemindex", "moz_bookmarks", "fk, type", "" \ |
michael@0 | 80 | ) |
michael@0 | 81 | |
michael@0 | 82 | #define CREATE_IDX_MOZ_BOOKMARKS_PARENTPOSITION \ |
michael@0 | 83 | CREATE_PLACES_IDX( \ |
michael@0 | 84 | "parentindex", "moz_bookmarks", "parent, position", "" \ |
michael@0 | 85 | ) |
michael@0 | 86 | |
michael@0 | 87 | #define CREATE_IDX_MOZ_BOOKMARKS_PLACELASTMODIFIED \ |
michael@0 | 88 | CREATE_PLACES_IDX( \ |
michael@0 | 89 | "itemlastmodifiedindex", "moz_bookmarks", "fk, lastModified", "" \ |
michael@0 | 90 | ) |
michael@0 | 91 | |
michael@0 | 92 | #define CREATE_IDX_MOZ_BOOKMARKS_GUID \ |
michael@0 | 93 | CREATE_PLACES_IDX( \ |
michael@0 | 94 | "guid_uniqueindex", "moz_bookmarks", "guid", "UNIQUE" \ |
michael@0 | 95 | ) |
michael@0 | 96 | |
michael@0 | 97 | /** |
michael@0 | 98 | * moz_annos |
michael@0 | 99 | */ |
michael@0 | 100 | |
michael@0 | 101 | #define CREATE_IDX_MOZ_ANNOS_PLACEATTRIBUTE \ |
michael@0 | 102 | CREATE_PLACES_IDX( \ |
michael@0 | 103 | "placeattributeindex", "moz_annos", "place_id, anno_attribute_id", "UNIQUE" \ |
michael@0 | 104 | ) |
michael@0 | 105 | |
michael@0 | 106 | /** |
michael@0 | 107 | * moz_items_annos |
michael@0 | 108 | */ |
michael@0 | 109 | |
michael@0 | 110 | #define CREATE_IDX_MOZ_ITEMSANNOS_PLACEATTRIBUTE \ |
michael@0 | 111 | CREATE_PLACES_IDX( \ |
michael@0 | 112 | "itemattributeindex", "moz_items_annos", "item_id, anno_attribute_id", "UNIQUE" \ |
michael@0 | 113 | ) |
michael@0 | 114 | |
michael@0 | 115 | /** |
michael@0 | 116 | * moz_favicons |
michael@0 | 117 | */ |
michael@0 | 118 | |
michael@0 | 119 | #define CREATE_IDX_MOZ_FAVICONS_GUID \ |
michael@0 | 120 | CREATE_PLACES_IDX( \ |
michael@0 | 121 | "guid_uniqueindex", "moz_favicons", "guid", "UNIQUE" \ |
michael@0 | 122 | ) |
michael@0 | 123 | |
michael@0 | 124 | #endif // nsPlacesIndexes_h__ |