toolkit/components/places/nsPlacesModule.cpp

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 "mozilla/ModuleUtils.h"
michael@0 6 #include "nsIClassInfoImpl.h"
michael@0 7
michael@0 8 #include "nsAnnoProtocolHandler.h"
michael@0 9 #include "nsAnnotationService.h"
michael@0 10 #include "nsNavHistory.h"
michael@0 11 #include "nsNavBookmarks.h"
michael@0 12 #include "nsFaviconService.h"
michael@0 13 #include "History.h"
michael@0 14 #include "nsDocShellCID.h"
michael@0 15
michael@0 16 using namespace mozilla::places;
michael@0 17
michael@0 18 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsNavHistory,
michael@0 19 nsNavHistory::GetSingleton)
michael@0 20 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsAnnotationService,
michael@0 21 nsAnnotationService::GetSingleton)
michael@0 22 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsNavBookmarks,
michael@0 23 nsNavBookmarks::GetSingleton)
michael@0 24 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsFaviconService,
michael@0 25 nsFaviconService::GetSingleton)
michael@0 26 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(History, History::GetSingleton)
michael@0 27
michael@0 28 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAnnoProtocolHandler)
michael@0 29 NS_DEFINE_NAMED_CID(NS_NAVHISTORYSERVICE_CID);
michael@0 30 NS_DEFINE_NAMED_CID(NS_ANNOTATIONSERVICE_CID);
michael@0 31 NS_DEFINE_NAMED_CID(NS_ANNOPROTOCOLHANDLER_CID);
michael@0 32 NS_DEFINE_NAMED_CID(NS_NAVBOOKMARKSSERVICE_CID);
michael@0 33 NS_DEFINE_NAMED_CID(NS_FAVICONSERVICE_CID);
michael@0 34 NS_DEFINE_NAMED_CID(NS_HISTORYSERVICE_CID);
michael@0 35
michael@0 36 const mozilla::Module::CIDEntry kPlacesCIDs[] = {
michael@0 37 { &kNS_NAVHISTORYSERVICE_CID, false, nullptr, nsNavHistoryConstructor },
michael@0 38 { &kNS_ANNOTATIONSERVICE_CID, false, nullptr, nsAnnotationServiceConstructor },
michael@0 39 { &kNS_ANNOPROTOCOLHANDLER_CID, false, nullptr, nsAnnoProtocolHandlerConstructor },
michael@0 40 { &kNS_NAVBOOKMARKSSERVICE_CID, false, nullptr, nsNavBookmarksConstructor },
michael@0 41 { &kNS_FAVICONSERVICE_CID, false, nullptr, nsFaviconServiceConstructor },
michael@0 42 { &kNS_HISTORYSERVICE_CID, false, nullptr, HistoryConstructor },
michael@0 43 { nullptr }
michael@0 44 };
michael@0 45
michael@0 46 const mozilla::Module::ContractIDEntry kPlacesContracts[] = {
michael@0 47 { NS_NAVHISTORYSERVICE_CONTRACTID, &kNS_NAVHISTORYSERVICE_CID },
michael@0 48 { NS_ANNOTATIONSERVICE_CONTRACTID, &kNS_ANNOTATIONSERVICE_CID },
michael@0 49 { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-anno", &kNS_ANNOPROTOCOLHANDLER_CID },
michael@0 50 { NS_NAVBOOKMARKSSERVICE_CONTRACTID, &kNS_NAVBOOKMARKSSERVICE_CID },
michael@0 51 { NS_FAVICONSERVICE_CONTRACTID, &kNS_FAVICONSERVICE_CID },
michael@0 52 { "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1", &kNS_NAVHISTORYSERVICE_CID },
michael@0 53 { NS_IHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID },
michael@0 54 { NS_DOWNLOADHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID },
michael@0 55 { nullptr }
michael@0 56 };
michael@0 57
michael@0 58 const mozilla::Module::CategoryEntry kPlacesCategories[] = {
michael@0 59 { "vacuum-participant", "Places", NS_NAVHISTORYSERVICE_CONTRACTID },
michael@0 60 { nullptr }
michael@0 61 };
michael@0 62
michael@0 63 const mozilla::Module kPlacesModule = {
michael@0 64 mozilla::Module::kVersion,
michael@0 65 kPlacesCIDs,
michael@0 66 kPlacesContracts,
michael@0 67 kPlacesCategories
michael@0 68 };
michael@0 69
michael@0 70 NSMODULE_DEFN(nsPlacesModule) = &kPlacesModule;

mercurial