parser/html/nsHtml5OwningUTF16Buffer.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser/html/nsHtml5OwningUTF16Buffer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,56 @@
     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 nsHtml5OwningUTF16Buffer_h
     1.9 +#define nsHtml5OwningUTF16Buffer_h
    1.10 +
    1.11 +#include "nsHtml5UTF16Buffer.h"
    1.12 +
    1.13 +class nsHtml5OwningUTF16Buffer : public nsHtml5UTF16Buffer
    1.14 +{
    1.15 +  private:
    1.16 +
    1.17 +    /**
    1.18 +     * Passes a buffer and its length to the superclass constructor.
    1.19 +     */
    1.20 +    nsHtml5OwningUTF16Buffer(char16_t* aBuffer);
    1.21 +
    1.22 +  public:
    1.23 +
    1.24 +    /**
    1.25 +     * Constructor for a parser key placeholder. (No actual buffer.)
    1.26 +     * @param aKey a parser key
    1.27 +     */
    1.28 +    nsHtml5OwningUTF16Buffer(void* aKey);
    1.29 +
    1.30 +    /**
    1.31 +     * Takes care of releasing the owned buffer.
    1.32 +     */
    1.33 +    ~nsHtml5OwningUTF16Buffer();
    1.34 +
    1.35 +    /**
    1.36 +     * The next buffer in a queue.
    1.37 +     */
    1.38 +    nsRefPtr<nsHtml5OwningUTF16Buffer> next;
    1.39 +
    1.40 +    /**
    1.41 +     * A parser key.
    1.42 +     */
    1.43 +    void* key;
    1.44 +
    1.45 +    static already_AddRefed<nsHtml5OwningUTF16Buffer>
    1.46 +    FalliblyCreate(int32_t aLength);
    1.47 +
    1.48 +    /**
    1.49 +     * Swap start, end and buffer fields with another object.
    1.50 +     */
    1.51 +    void Swap(nsHtml5OwningUTF16Buffer* aOther);
    1.52 +
    1.53 +    nsrefcnt AddRef();
    1.54 +    nsrefcnt Release();
    1.55 +  private:
    1.56 +    nsAutoRefCnt mRefCnt;
    1.57 +};
    1.58 +
    1.59 +#endif // nsHtml5OwningUTF16Buffer_h

mercurial