tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsHtml5UTF16BufferCppSupplement.h (818B)


      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/. */
      4 
      5 nsHtml5UTF16Buffer::nsHtml5UTF16Buffer(char16_t* aBuffer, int32_t aEnd)
      6    : buffer(aBuffer), start(0), end(aEnd) {
      7  MOZ_COUNT_CTOR(nsHtml5UTF16Buffer);
      8 }
      9 
     10 nsHtml5UTF16Buffer::~nsHtml5UTF16Buffer() {
     11  MOZ_COUNT_DTOR(nsHtml5UTF16Buffer);
     12 }
     13 
     14 void nsHtml5UTF16Buffer::DeleteBuffer() { delete[] buffer; }
     15 
     16 void nsHtml5UTF16Buffer::Swap(nsHtml5UTF16Buffer* aOther) {
     17  char16_t* tempBuffer = buffer;
     18  int32_t tempStart = start;
     19  int32_t tempEnd = end;
     20  buffer = aOther->buffer;
     21  start = aOther->start;
     22  end = aOther->end;
     23  aOther->buffer = tempBuffer;
     24  aOther->start = tempStart;
     25  aOther->end = tempEnd;
     26 }