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..d5b213cd8e45c7dcc3fcf1f317949006124ebf57 100644 |
--- a/third_party/WebKit/Source/core/fetch/TextResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/TextResource.cpp |
@@ -32,16 +32,22 @@ String TextResource::encoding() const |
String TextResource::decodedText() const |
{ |
+ size_t position = 0; |
+ return streamDecodedText(&position); |
+} |
+ |
+String TextResource::streamDecodedText(size_t* position) const |
+{ |
ASSERT(m_data); |
Yoav Weiss
2016/03/30 21:38:31
ASSERT that position is not null
Charlie Harrison
2016/03/31 03:59:59
Done.
|
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(); |
} |