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 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "mozilla/ModuleUtils.h"
6 #include "nsIClassInfoImpl.h"
8 #include "nsAnnoProtocolHandler.h"
9 #include "nsAnnotationService.h"
10 #include "nsNavHistory.h"
11 #include "nsNavBookmarks.h"
12 #include "nsFaviconService.h"
13 #include "History.h"
14 #include "nsDocShellCID.h"
16 using namespace mozilla::places;
18 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsNavHistory,
19 nsNavHistory::GetSingleton)
20 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsAnnotationService,
21 nsAnnotationService::GetSingleton)
22 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsNavBookmarks,
23 nsNavBookmarks::GetSingleton)
24 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsFaviconService,
25 nsFaviconService::GetSingleton)
26 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(History, History::GetSingleton)
28 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAnnoProtocolHandler)
29 NS_DEFINE_NAMED_CID(NS_NAVHISTORYSERVICE_CID);
30 NS_DEFINE_NAMED_CID(NS_ANNOTATIONSERVICE_CID);
31 NS_DEFINE_NAMED_CID(NS_ANNOPROTOCOLHANDLER_CID);
32 NS_DEFINE_NAMED_CID(NS_NAVBOOKMARKSSERVICE_CID);
33 NS_DEFINE_NAMED_CID(NS_FAVICONSERVICE_CID);
34 NS_DEFINE_NAMED_CID(NS_HISTORYSERVICE_CID);
36 const mozilla::Module::CIDEntry kPlacesCIDs[] = {
37 { &kNS_NAVHISTORYSERVICE_CID, false, nullptr, nsNavHistoryConstructor },
38 { &kNS_ANNOTATIONSERVICE_CID, false, nullptr, nsAnnotationServiceConstructor },
39 { &kNS_ANNOPROTOCOLHANDLER_CID, false, nullptr, nsAnnoProtocolHandlerConstructor },
40 { &kNS_NAVBOOKMARKSSERVICE_CID, false, nullptr, nsNavBookmarksConstructor },
41 { &kNS_FAVICONSERVICE_CID, false, nullptr, nsFaviconServiceConstructor },
42 { &kNS_HISTORYSERVICE_CID, false, nullptr, HistoryConstructor },
43 { nullptr }
44 };
46 const mozilla::Module::ContractIDEntry kPlacesContracts[] = {
47 { NS_NAVHISTORYSERVICE_CONTRACTID, &kNS_NAVHISTORYSERVICE_CID },
48 { NS_ANNOTATIONSERVICE_CONTRACTID, &kNS_ANNOTATIONSERVICE_CID },
49 { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-anno", &kNS_ANNOPROTOCOLHANDLER_CID },
50 { NS_NAVBOOKMARKSSERVICE_CONTRACTID, &kNS_NAVBOOKMARKSSERVICE_CID },
51 { NS_FAVICONSERVICE_CONTRACTID, &kNS_FAVICONSERVICE_CID },
52 { "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1", &kNS_NAVHISTORYSERVICE_CID },
53 { NS_IHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID },
54 { NS_DOWNLOADHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID },
55 { nullptr }
56 };
58 const mozilla::Module::CategoryEntry kPlacesCategories[] = {
59 { "vacuum-participant", "Places", NS_NAVHISTORYSERVICE_CONTRACTID },
60 { nullptr }
61 };
63 const mozilla::Module kPlacesModule = {
64 mozilla::Module::kVersion,
65 kPlacesCIDs,
66 kPlacesContracts,
67 kPlacesCategories
68 };
70 NSMODULE_DEFN(nsPlacesModule) = &kPlacesModule;