dom/xslt/base/txOwningArray.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 /* vim:set ts=2 sw=2 sts=2 et cindent: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef txOwningArray_h__
     8 #define txOwningArray_h__
    10 // Class acting like a nsTArray except that it deletes its objects
    11 // on destruction. It does not however delete its objects on operations
    12 // like RemoveElementsAt or on |array[i] = bar|.
    14 template<class E>
    15 class txOwningArray : public nsTArray<E*>
    16 {
    17 public:
    18     typedef nsTArray<E*> base_type;
    19     typedef typename base_type::elem_type elem_type;
    21     ~txOwningArray()
    22     {
    23         elem_type* iter = base_type::Elements();
    24         elem_type* end = iter + base_type::Length();
    25         for (; iter < end; ++iter) {
    26             delete *iter;
    27         }
    28     }
    30 };
    32 #endif // txOwningArray_h__

mercurial