| Index: Source/modules/encoding/TextDecoder.h
|
| diff --git a/Source/core/html/ime/Composition.h b/Source/modules/encoding/TextDecoder.h
|
| similarity index 66%
|
| copy from Source/core/html/ime/Composition.h
|
| copy to Source/modules/encoding/TextDecoder.h
|
| index a180c867ee04b86b3d343b4a05b3ef05f78ae4ab..8b0975047841edfaebf2891c79ab55568da89fa5 100644
|
| --- a/Source/core/html/ime/Composition.h
|
| +++ b/Source/modules/encoding/TextDecoder.h
|
| @@ -28,42 +28,41 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef Composition_h
|
| -#define Composition_h
|
| +#ifndef TextDecoder_h
|
| +#define TextDecoder_h
|
|
|
| -#include "bindings/v8/ScriptWrappable.h"
|
| -#include "wtf/PassRefPtr.h"
|
| +#include "bindings/v8/Dictionary.h"
|
| +#include "wtf/ArrayBufferView.h"
|
| #include "wtf/RefCounted.h"
|
| -#include "wtf/RefPtr.h"
|
| +#include "wtf/text/TextCodec.h"
|
| +#include "wtf/text/TextEncoding.h"
|
| #include "wtf/text/WTFString.h"
|
|
|
| namespace WebCore {
|
|
|
| -class Composition : public RefCounted<Composition>, public ScriptWrappable {
|
| -public:
|
| - static PassRefPtr<Composition> create();
|
| - ~Composition();
|
| -
|
| - String text() const { return m_text; }
|
| - void setText(const String& text) { m_text = text; }
|
| +class ExceptionState;
|
|
|
| - int selectionStart() const { return m_selectionStart; }
|
| - void setSelectionStart(int selectionStart) { selectionStart = m_selectionStart; }
|
| +class TextDecoder : public RefCounted<TextDecoder> {
|
| +public:
|
| + static PassRefPtr<TextDecoder> create(const String& label, const Dictionary&, ExceptionState&);
|
| + virtual ~TextDecoder();
|
|
|
| - int selectionEnd() const { return m_selectionEnd; }
|
| - void setSelectionEnd(int selectionEnd) { selectionEnd = m_selectionEnd; }
|
| + // Implement the IDL
|
| + String encoding() const;
|
| + String decode(ArrayBufferView*, const Dictionary&, ExceptionState&);
|
| + String decode(ExceptionState& es) { return decode(0, Dictionary(), es); }
|
|
|
| - const Vector<unsigned>& getSegments() const;
|
| + using RefCounted<TextDecoder>::ref;
|
| + using RefCounted<TextDecoder>::deref;
|
|
|
| private:
|
| - Composition();
|
| + TextDecoder(const String& encoding, bool fatal);
|
|
|
| - String m_text;
|
| - int m_selectionStart;
|
| - int m_selectionEnd;
|
| - Vector<unsigned> m_segments;
|
| + WTF::TextEncoding m_encoding;
|
| + OwnPtr<WTF::TextCodec> m_codec;
|
| + bool m_fatal;
|
| };
|
|
|
| } // namespace WebCore
|
|
|
| -#endif // Composition_h
|
| +#endif // TextDecoder_h
|
|
|