| Index: Source/modules/encoding/TextEncoder.h
|
| diff --git a/Source/modules/donottrack/NavigatorDoNotTrack.h b/Source/modules/encoding/TextEncoder.h
|
| similarity index 69%
|
| copy from Source/modules/donottrack/NavigatorDoNotTrack.h
|
| copy to Source/modules/encoding/TextEncoder.h
|
| index 0c044e7cd8edef2f8860c374d59f077e1e963816..08199a8a28fbeb407d56e0d153e6d8999b3d9cd5 100644
|
| --- a/Source/modules/donottrack/NavigatorDoNotTrack.h
|
| +++ b/Source/modules/encoding/TextEncoder.h
|
| @@ -28,32 +28,40 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef NavigatorDoNotTrack_h
|
| -#define NavigatorDoNotTrack_h
|
| +#ifndef TextEncoder_h
|
| +#define TextEncoder_h
|
|
|
| -#include "core/page/DOMWindowProperty.h"
|
| -#include "core/platform/Supplementable.h"
|
| +#include "wtf/ArrayBufferView.h"
|
| +#include "wtf/RefCounted.h"
|
| +#include "wtf/Uint8Array.h"
|
| +#include "wtf/text/TextCodec.h"
|
| +#include "wtf/text/TextEncoding.h"
|
| #include "wtf/text/WTFString.h"
|
|
|
| namespace WebCore {
|
|
|
| -class Frame;
|
| -class Navigator;
|
| +class Dictionary;
|
| +class ExceptionState;
|
|
|
| -class NavigatorDoNotTrack : public Supplement<Navigator>, public DOMWindowProperty {
|
| +class TextEncoder : public RefCounted<TextEncoder> {
|
| public:
|
| - virtual ~NavigatorDoNotTrack();
|
| - static NavigatorDoNotTrack* from(Navigator*);
|
| + static PassRefPtr<TextEncoder> create(const String& utfLabel, ExceptionState&);
|
| + virtual ~TextEncoder();
|
|
|
| - static String doNotTrack(Navigator*);
|
| + // Implement the IDL
|
| + String encoding() const;
|
| + PassRefPtr<Uint8Array> encode(const String&, const Dictionary&);
|
|
|
| - String doNotTrack();
|
| + using RefCounted<TextEncoder>::ref;
|
| + using RefCounted<TextEncoder>::deref;
|
|
|
| private:
|
| - explicit NavigatorDoNotTrack(Frame*);
|
| - static const char* supplementName();
|
| + TextEncoder(const String& encoding);
|
| +
|
| + WTF::TextEncoding m_encoding;
|
| + OwnPtr<WTF::TextCodec> m_codec;
|
| };
|
|
|
| } // namespace WebCore
|
|
|
| -#endif // NavigatorDoNotTrack_h
|
| +#endif // TextEncoder_h
|
|
|