summaryrefslogtreecommitdiffstats
path: root/WebCore/html/FileReader.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/FileReader.h')
-rw-r--r--WebCore/html/FileReader.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/WebCore/html/FileReader.h b/WebCore/html/FileReader.h
index b30fad7..80d425c 100644
--- a/WebCore/html/FileReader.h
+++ b/WebCore/html/FileReader.h
@@ -51,6 +51,7 @@ class Blob;
class File;
class FileStreamProxy;
class ScriptExecutionContext;
+class TextResourceDecoder;
class FileReader : public RefCounted<FileReader>, public ActiveDOMObject, public EventTarget, public FileStreamClient {
public:
@@ -72,7 +73,7 @@ public:
void readAsDataURL(File*);
void abort();
- ReadyState readyState() const { return m_state; }
+ ReadyState readyState() const;
PassRefPtr<FileError> error() { return m_error; }
const ScriptString& result();
@@ -108,6 +109,13 @@ private:
ReadFileAsText,
ReadFileAsDataURL
};
+ enum InternalState {
+ None,
+ Starting,
+ Opening,
+ Reading,
+ Completed
+ };
FileReader(ScriptExecutionContext*);
@@ -123,11 +131,12 @@ private:
void convertToText();
void convertToDataURL();
- ReadyState m_state;
+ InternalState m_state;
EventTargetData m_eventTargetData;
RefPtr<Blob> m_fileBlob;
ReadType m_readType;
+ TextEncoding m_encoding;
// Like XMLHttpRequest.m_responseText, we keep this as a ScriptString, not a WebCore::String.
// That's because these strings can easily get huge (they are filled from the file) and
@@ -141,8 +150,8 @@ private:
Vector<char> m_rawData;
bool m_isRawDataConverted;
- // Encoding scheme used to decode the data.
- TextEncoding m_encoding;
+ // The decoder used to decode the text data.
+ RefPtr<TextResourceDecoder> m_decoder;
// Needed to create data URL.
String m_fileType;
@@ -153,7 +162,6 @@ private:
long long m_bytesLoaded;
long long m_totalBytes;
double m_lastProgressNotificationTimeMS;
- bool m_alreadyStarted;
};
} // namespace WebCore