parser/html/nsHtml5DependentUTF16Buffer.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial