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.

     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 nsXBLProtoImplField_h__
     7 #define nsXBLProtoImplField_h__
     9 #include "nsIAtom.h"
    10 #include "nsString.h"
    11 #include "jsapi.h"
    12 #include "nsString.h"
    13 #include "nsXBLProtoImplMember.h"
    15 class nsIObjectInputStream;
    16 class nsIObjectOutputStream;
    17 class nsIScriptContext;
    18 class nsIURI;
    20 class nsXBLProtoImplField
    21 {
    22 public:
    23   nsXBLProtoImplField(const char16_t* aName, const char16_t* aReadOnly);
    24   nsXBLProtoImplField(const bool aIsReadOnly);
    25   ~nsXBLProtoImplField();
    27   void AppendFieldText(const nsAString& aText);
    28   void SetLineNumber(uint32_t aLineNumber) {
    29     mLineNumber = aLineNumber;
    30   }
    32   nsXBLProtoImplField* GetNext() const { return mNext; }
    33   void SetNext(nsXBLProtoImplField* aNext) { mNext = aNext; }
    35   nsresult InstallField(JS::Handle<JSObject*> aBoundNode,
    36                         nsIURI* aBindingDocURI,
    37                         bool* aDidInstall) const;
    39   nsresult InstallAccessors(JSContext* aCx,
    40                             JS::Handle<JSObject*> aTargetClassObject);
    42   nsresult Read(nsIObjectInputStream* aStream);
    43   nsresult Write(nsIObjectOutputStream* aStream);
    45   const char16_t* GetName() const { return mName; }
    47   unsigned AccessorAttributes() const {
    48     return JSPROP_SHARED | JSPROP_GETTER | JSPROP_SETTER |
    49            (mJSAttributes & (JSPROP_ENUMERATE | JSPROP_PERMANENT));
    50   }
    52   bool IsEmpty() const { return mFieldTextLength == 0; }
    54 protected:
    55   nsXBLProtoImplField* mNext;
    56   char16_t* mName;
    57   char16_t* mFieldText;
    58   uint32_t mFieldTextLength;
    59   uint32_t mLineNumber;
    60   unsigned mJSAttributes;
    61 };
    63 #endif // nsXBLProtoImplField_h__

mercurial