| Index: Source/core/fetch/ScriptResource.cpp
|
| diff --git a/Source/core/fetch/ScriptResource.cpp b/Source/core/fetch/ScriptResource.cpp
|
| old mode 100644
|
| new mode 100755
|
| index 873ef3322722f711ff22d971252932b792fd5174..9137c80d61d3c7c37a206765e083f63b236eedb8
|
| --- a/Source/core/fetch/ScriptResource.cpp
|
| +++ b/Source/core/fetch/ScriptResource.cpp
|
| @@ -31,6 +31,7 @@
|
| #include "platform/MIMETypeRegistry.h"
|
| #include "platform/SharedBuffer.h"
|
| #include "platform/network/HTTPParsers.h"
|
| +#include "wtf/text/StringBuilder.h"
|
|
|
| namespace WebCore {
|
|
|
| @@ -71,14 +72,15 @@ const String& ScriptResource::script()
|
| ASSERT(isLoaded());
|
|
|
| if (!m_script && m_data) {
|
| - String script = m_decoder->decode(m_data->data(), encodedSize());
|
| + StringBuilder script;
|
| + script.append(m_decoder->decode(m_data->data(), encodedSize()));
|
| script.append(m_decoder->flush());
|
| m_data.clear();
|
| // We lie a it here and claim that script counts as encoded data (even though it's really decoded data).
|
| // That's because the MemoryCache thinks that it can clear out decoded data by calling destroyDecodedData(),
|
| // but we can't destroy script in destroyDecodedData because that's our only copy of the data!
|
| setEncodedSize(script.sizeInBytes());
|
| - m_script = script;
|
| + m_script = script.toString();
|
| }
|
|
|
| return m_script.string();
|
|
|