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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 | 195 |
196 DCHECK(m_parsedStyleSheetCache->isCacheableForResource()); | 196 DCHECK(m_parsedStyleSheetCache->isCacheableForResource()); |
197 DCHECK(m_parsedStyleSheetCache->isReferencedFromResource()); | 197 DCHECK(m_parsedStyleSheetCache->isReferencedFromResource()); |
198 | 198 |
199 // Contexts must be identical so we know we would get the same exact result if | 199 // Contexts must be identical so we know we would get the same exact result if |
200 // we parsed again. | 200 // we parsed again. |
201 if (m_parsedStyleSheetCache->parserContext() != context) | 201 if (m_parsedStyleSheetCache->parserContext() != context) |
202 return nullptr; | 202 return nullptr; |
203 | 203 |
204 didAccessDecodedData(); | |
205 | |
206 return m_parsedStyleSheetCache; | 204 return m_parsedStyleSheetCache; |
207 } | 205 } |
208 | 206 |
209 void CSSStyleSheetResource::saveParsedStyleSheet(StyleSheetContents* sheet) { | 207 void CSSStyleSheetResource::saveParsedStyleSheet(StyleSheetContents* sheet) { |
210 DCHECK(sheet); | 208 DCHECK(sheet); |
211 DCHECK(sheet->isCacheableForResource()); | 209 DCHECK(sheet->isCacheableForResource()); |
212 | 210 |
213 if (!memoryCache()->contains(this)) { | 211 if (!memoryCache()->contains(this)) { |
214 // This stylesheet resource did conflict with another resource and was not | 212 // This stylesheet resource did conflict with another resource and was not |
215 // added to the cache. | 213 // added to the cache. |
216 setParsedStyleSheetCache(nullptr); | 214 setParsedStyleSheetCache(nullptr); |
217 return; | 215 return; |
218 } | 216 } |
219 setParsedStyleSheetCache(sheet); | 217 setParsedStyleSheetCache(sheet); |
220 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); | 218 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); |
221 } | 219 } |
222 | 220 |
223 } // namespace blink | 221 } // namespace blink |
OLD | NEW |