2012-12-21 16:16:14 -08:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_workers_textencoder_h_
|
|
|
|
#define mozilla_dom_workers_textencoder_h_
|
|
|
|
|
|
|
|
#include "mozilla/dom/TextEncoderBase.h"
|
|
|
|
#include "mozilla/dom/workers/bindings/DOMBindingBase.h"
|
|
|
|
#include "mozilla/dom/TextEncoderBinding.h"
|
|
|
|
|
|
|
|
BEGIN_WORKERS_NAMESPACE
|
|
|
|
|
|
|
|
class TextEncoder MOZ_FINAL : public DOMBindingBase,
|
|
|
|
public TextEncoderBase
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
TextEncoder(JSContext* aCx)
|
|
|
|
: DOMBindingBase(aCx)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual
|
|
|
|
~TextEncoder()
|
|
|
|
{}
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual void
|
|
|
|
_trace(JSTracer* aTrc) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void
|
|
|
|
_finalize(JSFreeOp* aFop) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
static TextEncoder*
|
2012-12-03 08:07:49 -08:00
|
|
|
Constructor(const WorkerGlobalObject& aGlobal,
|
2012-12-21 16:16:14 -08:00
|
|
|
const nsAString& aEncoding,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
|
|
|
JSObject*
|
|
|
|
Encode(JSContext* aCx,
|
2013-08-22 22:17:07 -07:00
|
|
|
JS::Handle<JSObject*> aObj,
|
2012-12-21 16:16:14 -08:00
|
|
|
const nsAString& aString,
|
|
|
|
const TextEncodeOptionsWorkers& aOptions,
|
|
|
|
ErrorResult& aRv) {
|
2013-08-22 22:17:07 -07:00
|
|
|
return TextEncoderBase::Encode(aCx, aObj, aString, aOptions.mStream, aRv);
|
2012-12-21 16:16:14 -08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
END_WORKERS_NAMESPACE
|
|
|
|
|
|
|
|
#endif // mozilla_dom_workers_textencoder_h_
|