parser/html/nsHtml5DependentUTF16Buffer.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsHtml5DependentUTF16Buffer_h
     6 #define nsHtml5DependentUTF16Buffer_h
     8 #include "nscore.h"
     9 #include "nsHtml5OwningUTF16Buffer.h"
    11 class MOZ_STACK_CLASS nsHtml5DependentUTF16Buffer : public nsHtml5UTF16Buffer
    12 {
    13   public:
    14     /**
    15      * Wraps a string without taking ownership of the buffer. aToWrap MUST NOT
    16      * go away or be shortened while nsHtml5DependentUTF16Buffer is in use.
    17      */
    18     nsHtml5DependentUTF16Buffer(const nsAString& aToWrap);
    20     ~nsHtml5DependentUTF16Buffer();
    22     /**
    23      * Copies the currently unconsumed part of this buffer into a new
    24      * heap-allocated nsHtml5OwningUTF16Buffer. The new object is allocated
    25      * with a fallible allocator. If the allocation fails, nullptr is returned.
    26      * @return heap-allocated copy or nullptr if memory allocation failed
    27      */
    28     already_AddRefed<nsHtml5OwningUTF16Buffer> FalliblyCopyAsOwningBuffer();
    29 };
    31 #endif // nsHtml5DependentUTF16Buffer_h

mercurial