Index: third_party/WebKit/Source/core/fetch/TextResource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/TextResource.cpp b/third_party/WebKit/Source/core/fetch/TextResource.cpp |
index f4878dd3c04ced697feb7a0274df619b21e602aa..6dd62b6b6aab26ed67a63b6cd7b78e84d0e1e940 100644 |
--- a/third_party/WebKit/Source/core/fetch/TextResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/TextResource.cpp |
@@ -32,16 +32,23 @@ String TextResource::encoding() const |
String TextResource::decodedText() const |
{ |
+ size_t position = 0; |
+ return streamDecodedText(&position); |
+} |
+ |
+String TextResource::streamDecodedText(size_t* position) const |
+{ |
+ ASSERT(position); |
ASSERT(m_data); |
StringBuilder builder; |
const char* data; |
- size_t position = 0; |
- while (size_t length = m_data->getSomeData(data, position)) { |
+ while (size_t length = m_data->getSomeData(data, *position)) { |
builder.append(m_decoder->decode(data, length)); |
- position += length; |
+ *position += length; |
} |
builder.append(m_decoder->flush()); |
+ |
return builder.toString(); |
} |