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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsStringBundleService_h__
7 #define nsStringBundleService_h__
9 #include "nsCOMPtr.h"
10 #include "nsDataHashtable.h"
11 #include "nsHashKeys.h"
12 #include "nsIPersistentProperties2.h"
13 #include "nsIStringBundle.h"
14 #include "nsIObserver.h"
15 #include "nsWeakReference.h"
16 #include "nsIErrorService.h"
17 #include "nsIStringBundleOverride.h"
19 #include "mozilla/LinkedList.h"
21 struct bundleCacheEntry_t;
23 class nsStringBundleService : public nsIStringBundleService,
24 public nsIObserver,
25 public nsSupportsWeakReference
26 {
27 public:
28 nsStringBundleService();
29 virtual ~nsStringBundleService();
31 nsresult Init();
33 NS_DECL_ISUPPORTS
34 NS_DECL_NSISTRINGBUNDLESERVICE
35 NS_DECL_NSIOBSERVER
37 private:
38 nsresult getStringBundle(const char *aUrl, nsIStringBundle** aResult);
39 nsresult FormatWithBundle(nsIStringBundle* bundle, nsresult aStatus,
40 uint32_t argCount, char16_t** argArray,
41 char16_t* *result);
43 void flushBundleCache();
45 bundleCacheEntry_t *insertIntoCache(already_AddRefed<nsIStringBundle> aBundle,
46 nsCString &aHashKey);
48 nsDataHashtable<nsCStringHashKey, bundleCacheEntry_t*> mBundleMap;
49 mozilla::LinkedList<bundleCacheEntry_t> mBundleCache;
51 nsCOMPtr<nsIErrorService> mErrorService;
52 nsCOMPtr<nsIStringBundleOverride> mOverrideStrings;
53 };
55 #endif