Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 6 Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 { | 81 { |
| 82 ASSERT(!isPurgeable()); | 82 ASSERT(!isPurgeable()); |
| 83 | 83 |
| 84 if (!m_data || m_data->isEmpty() || !canUseSheet(enforceMIMEType, hasValidMI METype)) | 84 if (!m_data || m_data->isEmpty() || !canUseSheet(enforceMIMEType, hasValidMI METype)) |
| 85 return String(); | 85 return String(); |
| 86 | 86 |
| 87 if (!m_decodedSheetText.isNull()) | 87 if (!m_decodedSheetText.isNull()) |
| 88 return m_decodedSheetText; | 88 return m_decodedSheetText; |
| 89 | 89 |
| 90 // Don't cache the decoded text, regenerating is cheap and it can use quite a bit of memory | 90 // Don't cache the decoded text, regenerating is cheap and it can use quite a bit of memory |
| 91 String sheetText = m_decoder->decode(m_data->data(), m_data->size()); | 91 String sheetText = m_decoder->decode(m_data->data(), m_data->size()) + m_dec oder->flush(); |
|
abarth-chromium
2014/01/07 16:10:33
This change is wrong because the order of evaluati
| |
| 92 sheetText.append(m_decoder->flush()); | |
| 93 return sheetText; | 92 return sheetText; |
| 94 } | 93 } |
| 95 | 94 |
| 96 void CSSStyleSheetResource::checkNotify() | 95 void CSSStyleSheetResource::checkNotify() |
| 97 { | 96 { |
| 98 // Decode the data to find out the encoding and keep the sheet text around d uring checkNotify() | 97 // Decode the data to find out the encoding and keep the sheet text around d uring checkNotify() |
| 99 if (m_data) { | 98 if (m_data) { |
| 100 m_decodedSheetText = m_decoder->decode(m_data->data(), m_data->size()); | 99 m_decodedSheetText = m_decoder->decode(m_data->data(), m_data->size()); |
| 101 m_decodedSheetText.append(m_decoder->flush()); | 100 m_decodedSheetText.append(m_decoder->flush()); |
| 102 } | 101 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 | 173 |
| 175 if (m_parsedStyleSheetCache) | 174 if (m_parsedStyleSheetCache) |
| 176 m_parsedStyleSheetCache->removedFromMemoryCache(); | 175 m_parsedStyleSheetCache->removedFromMemoryCache(); |
| 177 m_parsedStyleSheetCache = sheet; | 176 m_parsedStyleSheetCache = sheet; |
| 178 m_parsedStyleSheetCache->addedToMemoryCache(); | 177 m_parsedStyleSheetCache->addedToMemoryCache(); |
| 179 | 178 |
| 180 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); | 179 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); |
| 181 } | 180 } |
| 182 | 181 |
| 183 } | 182 } |
| OLD | NEW |