2012-05-29 15:52:43 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-09-28 12:45:17 +00:00
|
|
|
|
2013-08-23 15:07:10 +00:00
|
|
|
#ifndef nsHtml5OwningUTF16Buffer_h
|
|
|
|
#define nsHtml5OwningUTF16Buffer_h
|
2011-09-28 12:45:17 +00:00
|
|
|
|
|
|
|
#include "nsHtml5UTF16Buffer.h"
|
|
|
|
|
|
|
|
class nsHtml5OwningUTF16Buffer : public nsHtml5UTF16Buffer
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Passes a buffer and its length to the superclass constructor.
|
|
|
|
*/
|
2014-09-01 22:04:20 +00:00
|
|
|
explicit nsHtml5OwningUTF16Buffer(char16_t* aBuffer);
|
2011-09-28 12:45:17 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor for a parser key placeholder. (No actual buffer.)
|
|
|
|
* @param aKey a parser key
|
|
|
|
*/
|
2014-09-01 22:04:20 +00:00
|
|
|
explicit nsHtml5OwningUTF16Buffer(void* aKey);
|
2011-09-28 12:45:17 +00:00
|
|
|
|
2014-07-15 15:37:45 +00:00
|
|
|
protected:
|
2011-09-28 12:45:17 +00:00
|
|
|
/**
|
|
|
|
* Takes care of releasing the owned buffer.
|
|
|
|
*/
|
|
|
|
~nsHtml5OwningUTF16Buffer();
|
|
|
|
|
2014-07-15 15:37:45 +00:00
|
|
|
public:
|
2011-09-28 12:45:17 +00:00
|
|
|
/**
|
|
|
|
* The next buffer in a queue.
|
|
|
|
*/
|
2015-10-18 05:24:48 +00:00
|
|
|
RefPtr<nsHtml5OwningUTF16Buffer> next;
|
2011-09-28 12:45:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A parser key.
|
|
|
|
*/
|
|
|
|
void* key;
|
|
|
|
|
|
|
|
static already_AddRefed<nsHtml5OwningUTF16Buffer>
|
2012-08-22 15:56:38 +00:00
|
|
|
FalliblyCreate(int32_t aLength);
|
2011-09-28 12:45:17 +00:00
|
|
|
|
2011-10-29 20:14:31 +00:00
|
|
|
/**
|
|
|
|
* Swap start, end and buffer fields with another object.
|
|
|
|
*/
|
|
|
|
void Swap(nsHtml5OwningUTF16Buffer* aOther);
|
|
|
|
|
2011-09-28 12:45:17 +00:00
|
|
|
nsrefcnt AddRef();
|
|
|
|
nsrefcnt Release();
|
|
|
|
private:
|
|
|
|
nsAutoRefCnt mRefCnt;
|
|
|
|
};
|
|
|
|
|
2013-08-23 15:07:10 +00:00
|
|
|
#endif // nsHtml5OwningUTF16Buffer_h
|