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 nsXBLProtoImplProperty_h__
7 #define nsXBLProtoImplProperty_h__
9 #include "mozilla/Attributes.h"
10 #include "nsIAtom.h"
11 #include "nsString.h"
12 #include "nsString.h"
13 #include "nsXBLSerialize.h"
14 #include "nsXBLMaybeCompiled.h"
15 #include "nsXBLProtoImplMember.h"
17 class nsXBLProtoImplProperty: public nsXBLProtoImplMember
18 {
19 public:
20 nsXBLProtoImplProperty(const char16_t* aName,
21 const char16_t* aGetter,
22 const char16_t* aSetter,
23 const char16_t* aReadOnly,
24 uint32_t aLineNumber);
26 nsXBLProtoImplProperty(const char16_t* aName, const bool aIsReadOnly);
28 virtual ~nsXBLProtoImplProperty();
30 void AppendGetterText(const nsAString& aGetter);
31 void AppendSetterText(const nsAString& aSetter);
33 void SetGetterLineNumber(uint32_t aLineNumber);
34 void SetSetterLineNumber(uint32_t aLineNumber);
36 virtual nsresult InstallMember(JSContext* aCx,
37 JS::Handle<JSObject*> aTargetClassObject) MOZ_OVERRIDE;
38 virtual nsresult CompileMember(const nsCString& aClassStr,
39 JS::Handle<JSObject*> aClassObject) MOZ_OVERRIDE;
41 virtual void Trace(const TraceCallbacks& aCallback, void *aClosure) MOZ_OVERRIDE;
43 nsresult Read(nsIObjectInputStream* aStream,
44 XBLBindingSerializeDetails aType);
45 virtual nsresult Write(nsIObjectOutputStream* aStream) MOZ_OVERRIDE;
47 protected:
48 typedef JS::Heap<nsXBLMaybeCompiled<nsXBLTextWithLineNumber> > PropertyOp;
50 void EnsureUncompiledText(PropertyOp& aPropertyOp);
52 // The raw text for the getter, or the JS object (after compilation).
53 PropertyOp mGetter;
55 // The raw text for the setter, or the JS object (after compilation).
56 PropertyOp mSetter;
58 unsigned mJSAttributes; // A flag for all our JS properties (getter/setter/readonly/shared/enum)
60 #ifdef DEBUG
61 bool mIsCompiled;
62 #endif
63 };
65 #endif // nsXBLProtoImplProperty_h__