Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1176)

Unified Diff: Source/modules/encoding/TextDecoder.h

Issue 15901002: Implement Encoding API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaseline webexposed global constructor tests Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/RuntimeEnabledFeatures.in ('k') | Source/modules/encoding/TextDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/page/RuntimeEnabledFeatures.in ('k') | Source/modules/encoding/TextDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698