Chromium Code Reviews| Index: third_party/WebKit/Source/core/fetch/ScriptResource.cpp |
| diff --git a/third_party/WebKit/Source/core/fetch/ScriptResource.cpp b/third_party/WebKit/Source/core/fetch/ScriptResource.cpp |
| index 20ab4a340557c1a2672025a4b7243bf79ae3dc26..c7c3404111a86827fb48a04b53bf7a252dbb00e1 100644 |
| --- a/third_party/WebKit/Source/core/fetch/ScriptResource.cpp |
| +++ b/third_party/WebKit/Source/core/fetch/ScriptResource.cpp |
| @@ -79,7 +79,7 @@ void ScriptResource::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail, WebP |
| Resource::onMemoryDump(levelOfDetail, memoryDump); |
| const String name = getMemoryDumpName() + "/decoded_script"; |
| auto dump = memoryDump->createMemoryAllocatorDump(name); |
| - dump->addScalar("size", "bytes", m_script.string().sizeInBytes()); |
| + dump->addScalar("size", "bytes", m_script.contentSizeInBytes()); |
|
hajimehoshi
2015/11/26 10:56:20
I found this changes the meaning.
|
| memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName)); |
| } |
| @@ -88,27 +88,27 @@ AtomicString ScriptResource::mimeType() const |
| return extractMIMETypeFromMediaType(m_response.httpHeaderField("Content-Type")).lower(); |
| } |
| -const String& ScriptResource::script() |
| +const CompressibleString& ScriptResource::script() |
| { |
| ASSERT(!isPurgeable()); |
| ASSERT(isLoaded()); |
| - if (!m_script && m_data) { |
| + if (m_script.isNull() && m_data) { |
|
haraken
2015/11/26 11:50:03
Shouldn't this be !m_script.isNull()?
hajimehoshi
2015/11/27 11:03:58
Old |!m_script| means |m_script| is null. I think
|
| String script = decodedText(); |
| 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 = AtomicString(script); |
| + m_script = CompressibleString(script.impl()); |
| } |
| - return m_script.string(); |
| + return m_script; |
| } |
| void ScriptResource::destroyDecodedDataForFailedRevalidation() |
| { |
| - m_script = AtomicString(); |
| + m_script = CompressibleString(StringImpl::empty()); |
| } |
| bool ScriptResource::mimeTypeAllowedByNosniff() const |