| 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 5ec44e320521e772a3ed5da960bfb08142eb9c8f..3286b8005d75b57868c172005291c070c14dfec6 100644
|
| --- a/third_party/WebKit/Source/core/fetch/TextResource.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/TextResource.cpp
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "core/html/parser/TextResourceDecoder.h"
|
| #include "platform/SharedBuffer.h"
|
| +#include "wtf/text/StringBuilder.h"
|
|
|
| namespace blink {
|
|
|
| @@ -34,9 +35,15 @@ String TextResource::decodedText() const
|
| {
|
| ASSERT(m_data);
|
|
|
| - String text = m_decoder->decode(m_data->data(), encodedSize());
|
| - text.append(m_decoder->flush());
|
| - return text;
|
| + StringBuilder builder;
|
| + const char* data;
|
| + unsigned position = 0;
|
| + while (unsigned length = m_data->getSomeData(data, position)) {
|
| + builder.append(m_decoder->decode(data, length));
|
| + position += length;
|
| + }
|
| + builder.append(m_decoder->flush());
|
| + return builder.toString();
|
| }
|
|
|
| } // namespace blink
|
|
|