dom/xbl/nsXBLProtoImplField.h

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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsXBLProtoImplField_h__
michael@0 7 #define nsXBLProtoImplField_h__
michael@0 8
michael@0 9 #include "nsIAtom.h"
michael@0 10 #include "nsString.h"
michael@0 11 #include "jsapi.h"
michael@0 12 #include "nsString.h"
michael@0 13 #include "nsXBLProtoImplMember.h"
michael@0 14
michael@0 15 class nsIObjectInputStream;
michael@0 16 class nsIObjectOutputStream;
michael@0 17 class nsIScriptContext;
michael@0 18 class nsIURI;
michael@0 19
michael@0 20 class nsXBLProtoImplField
michael@0 21 {
michael@0 22 public:
michael@0 23 nsXBLProtoImplField(const char16_t* aName, const char16_t* aReadOnly);
michael@0 24 nsXBLProtoImplField(const bool aIsReadOnly);
michael@0 25 ~nsXBLProtoImplField();
michael@0 26
michael@0 27 void AppendFieldText(const nsAString& aText);
michael@0 28 void SetLineNumber(uint32_t aLineNumber) {
michael@0 29 mLineNumber = aLineNumber;
michael@0 30 }
michael@0 31
michael@0 32 nsXBLProtoImplField* GetNext() const { return mNext; }
michael@0 33 void SetNext(nsXBLProtoImplField* aNext) { mNext = aNext; }
michael@0 34
michael@0 35 nsresult InstallField(JS::Handle<JSObject*> aBoundNode,
michael@0 36 nsIURI* aBindingDocURI,
michael@0 37 bool* aDidInstall) const;
michael@0 38
michael@0 39 nsresult InstallAccessors(JSContext* aCx,
michael@0 40 JS::Handle<JSObject*> aTargetClassObject);
michael@0 41
michael@0 42 nsresult Read(nsIObjectInputStream* aStream);
michael@0 43 nsresult Write(nsIObjectOutputStream* aStream);
michael@0 44
michael@0 45 const char16_t* GetName() const { return mName; }
michael@0 46
michael@0 47 unsigned AccessorAttributes() const {
michael@0 48 return JSPROP_SHARED | JSPROP_GETTER | JSPROP_SETTER |
michael@0 49 (mJSAttributes & (JSPROP_ENUMERATE | JSPROP_PERMANENT));
michael@0 50 }
michael@0 51
michael@0 52 bool IsEmpty() const { return mFieldTextLength == 0; }
michael@0 53
michael@0 54 protected:
michael@0 55 nsXBLProtoImplField* mNext;
michael@0 56 char16_t* mName;
michael@0 57 char16_t* mFieldText;
michael@0 58 uint32_t mFieldTextLength;
michael@0 59 uint32_t mLineNumber;
michael@0 60 unsigned mJSAttributes;
michael@0 61 };
michael@0 62
michael@0 63 #endif // nsXBLProtoImplField_h__

mercurial