editor/libeditor/base/InsertElementTxn.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 InsertElementTxn_h__
     7 #define InsertElementTxn_h__
     9 #include "EditTxn.h"                    // for EditTxn, NS_DECL_EDITTXN
    10 #include "nsCOMPtr.h"                   // for nsCOMPtr
    11 #include "nsCycleCollectionParticipant.h"
    12 #include "nsIDOMNode.h"                 // for nsIDOMNode
    13 #include "nsISupportsImpl.h"            // for NS_DECL_ISUPPORTS_INHERITED
    14 #include "nscore.h"                     // for NS_IMETHOD
    16 class nsIEditor;
    18 /**
    19  * A transaction that inserts a single element
    20  */
    21 class InsertElementTxn : public EditTxn
    22 {
    23 public:
    24   /** initialize the transaction.
    25     * @param aNode   the node to insert
    26     * @param aParent the node to insert into
    27     * @param aOffset the offset in aParent to insert aNode
    28     */
    29   NS_IMETHOD Init(nsIDOMNode *aNode,
    30                   nsIDOMNode *aParent,
    31                   int32_t     aOffset,
    32                   nsIEditor  *aEditor);
    34   InsertElementTxn();
    36   NS_DECL_ISUPPORTS_INHERITED
    37   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(InsertElementTxn, EditTxn)
    39   NS_DECL_EDITTXN
    41 protected:
    43   /** the element to insert */
    44   nsCOMPtr<nsIDOMNode> mNode;
    46   /** the node into which the new node will be inserted */
    47   nsCOMPtr<nsIDOMNode> mParent;
    49   /** the editor for this transaction */
    50   nsIEditor*           mEditor;
    52   /** the index in mParent for the new node */
    53   int32_t mOffset;
    54 };
    56 #endif

mercurial