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: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 nsArrayUtils_h__
7 #define nsArrayUtils_h__
9 #include "nsCOMPtr.h"
10 #include "nsIArray.h"
12 // helper class for do_QueryElementAt
13 class NS_COM_GLUE nsQueryArrayElementAt : public nsCOMPtr_helper
14 {
15 public:
16 nsQueryArrayElementAt(nsIArray* aArray, uint32_t aIndex,
17 nsresult* aErrorPtr)
18 : mArray(aArray),
19 mIndex(aIndex),
20 mErrorPtr(aErrorPtr)
21 {
22 // nothing else to do here
23 }
25 virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const;
27 private:
28 nsIArray* mArray;
29 uint32_t mIndex;
30 nsresult* mErrorPtr;
31 };
33 inline
34 const nsQueryArrayElementAt
35 do_QueryElementAt(nsIArray* aArray, uint32_t aIndex, nsresult* aErrorPtr = 0)
36 {
37 return nsQueryArrayElementAt(aArray, aIndex, aErrorPtr);
38 }
40 #endif // nsArrayUtils_h__