| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 c->setCSSStyleSheet(resourceRequest().url(), response().url(), encoding(), | 146 c->setCSSStyleSheet(resourceRequest().url(), response().url(), encoding(), |
| 147 this); | 147 this); |
| 148 } | 148 } |
| 149 | 149 |
| 150 // Clear raw bytes as now we have the full decoded sheet text. | 150 // Clear raw bytes as now we have the full decoded sheet text. |
| 151 // We wait for all LinkStyle::setCSSStyleSheet to run (at least once) | 151 // We wait for all LinkStyle::setCSSStyleSheet to run (at least once) |
| 152 // as SubresourceIntegrity checks require raw bytes. | 152 // as SubresourceIntegrity checks require raw bytes. |
| 153 // Note that LinkStyle::setCSSStyleSheet can be called from didAddClient too, | 153 // Note that LinkStyle::setCSSStyleSheet can be called from didAddClient too, |
| 154 // but is safe as we should have a cached ResourceIntegrityDisposition. | 154 // but is safe as we should have a cached ResourceIntegrityDisposition. |
| 155 clearData(); | 155 clearData(); |
| 156 setEncodedSizeMemoryUsage(0); | |
| 157 } | 156 } |
| 158 | 157 |
| 159 void CSSStyleSheetResource::destroyDecodedDataIfPossible() { | 158 void CSSStyleSheetResource::destroyDecodedDataIfPossible() { |
| 160 if (!m_parsedStyleSheetCache) | 159 if (!m_parsedStyleSheetCache) |
| 161 return; | 160 return; |
| 162 | 161 |
| 163 setParsedStyleSheetCache(nullptr); | 162 setParsedStyleSheetCache(nullptr); |
| 164 } | 163 } |
| 165 | 164 |
| 166 void CSSStyleSheetResource::destroyDecodedDataForFailedRevalidation() { | 165 void CSSStyleSheetResource::destroyDecodedDataForFailedRevalidation() { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 227 } |
| 229 | 228 |
| 230 void CSSStyleSheetResource::updateDecodedSize() { | 229 void CSSStyleSheetResource::updateDecodedSize() { |
| 231 size_t decodedSize = m_decodedSheetText.charactersSizeInBytes(); | 230 size_t decodedSize = m_decodedSheetText.charactersSizeInBytes(); |
| 232 if (m_parsedStyleSheetCache) | 231 if (m_parsedStyleSheetCache) |
| 233 decodedSize += m_parsedStyleSheetCache->estimatedSizeInBytes(); | 232 decodedSize += m_parsedStyleSheetCache->estimatedSizeInBytes(); |
| 234 setDecodedSize(decodedSize); | 233 setDecodedSize(decodedSize); |
| 235 } | 234 } |
| 236 | 235 |
| 237 } // namespace blink | 236 } // namespace blink |
| OLD | NEW |