1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/parser/html/nsHtml5DependentUTF16Buffer.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef nsHtml5DependentUTF16Buffer_h 1.9 +#define nsHtml5DependentUTF16Buffer_h 1.10 + 1.11 +#include "nscore.h" 1.12 +#include "nsHtml5OwningUTF16Buffer.h" 1.13 + 1.14 +class MOZ_STACK_CLASS nsHtml5DependentUTF16Buffer : public nsHtml5UTF16Buffer 1.15 +{ 1.16 + public: 1.17 + /** 1.18 + * Wraps a string without taking ownership of the buffer. aToWrap MUST NOT 1.19 + * go away or be shortened while nsHtml5DependentUTF16Buffer is in use. 1.20 + */ 1.21 + nsHtml5DependentUTF16Buffer(const nsAString& aToWrap); 1.22 + 1.23 + ~nsHtml5DependentUTF16Buffer(); 1.24 + 1.25 + /** 1.26 + * Copies the currently unconsumed part of this buffer into a new 1.27 + * heap-allocated nsHtml5OwningUTF16Buffer. The new object is allocated 1.28 + * with a fallible allocator. If the allocation fails, nullptr is returned. 1.29 + * @return heap-allocated copy or nullptr if memory allocation failed 1.30 + */ 1.31 + already_AddRefed<nsHtml5OwningUTF16Buffer> FalliblyCopyAsOwningBuffer(); 1.32 +}; 1.33 + 1.34 +#endif // nsHtml5DependentUTF16Buffer_h