| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ
est, const ResourceLoaderOptions& options, const String& charset) | 52 CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ
est, const ResourceLoaderOptions& options, const String& charset) |
| 53 : StyleSheetResource(resourceRequest, CSSStyleSheet, options, "text/css", ch
arset) | 53 : StyleSheetResource(resourceRequest, CSSStyleSheet, options, "text/css", ch
arset) |
| 54 { | 54 { |
| 55 } | 55 } |
| 56 | 56 |
| 57 CSSStyleSheetResource::~CSSStyleSheetResource() | 57 CSSStyleSheetResource::~CSSStyleSheetResource() |
| 58 { | 58 { |
| 59 } | 59 } |
| 60 | 60 |
| 61 void CSSStyleSheetResource::willDestroyResourceInternal() | |
| 62 { | |
| 63 setParsedStyleSheetCache(nullptr); | |
| 64 } | |
| 65 | |
| 66 void CSSStyleSheetResource::setParsedStyleSheetCache(StyleSheetContents* newShee
t) | 61 void CSSStyleSheetResource::setParsedStyleSheetCache(StyleSheetContents* newShee
t) |
| 67 { | 62 { |
| 68 if (m_parsedStyleSheetCache) | 63 if (m_parsedStyleSheetCache) |
| 69 m_parsedStyleSheetCache->setReferencedFromResource(false); | 64 m_parsedStyleSheetCache->clearReferencedFromResource(); |
| 70 m_parsedStyleSheetCache = newSheet; | 65 m_parsedStyleSheetCache = newSheet; |
| 71 if (m_parsedStyleSheetCache) | 66 if (m_parsedStyleSheetCache) |
| 72 m_parsedStyleSheetCache->setReferencedFromResource(true); | 67 m_parsedStyleSheetCache->setReferencedFromResource(this); |
| 73 } | 68 } |
| 74 | 69 |
| 75 DEFINE_TRACE(CSSStyleSheetResource) | 70 DEFINE_TRACE(CSSStyleSheetResource) |
| 76 { | 71 { |
| 77 visitor->trace(m_parsedStyleSheetCache); | 72 visitor->trace(m_parsedStyleSheetCache); |
| 78 StyleSheetResource::trace(visitor); | 73 StyleSheetResource::trace(visitor); |
| 79 } | 74 } |
| 80 | 75 |
| 81 void CSSStyleSheetResource::didAddClient(ResourceClient* c) | 76 void CSSStyleSheetResource::didAddClient(ResourceClient* c) |
| 82 { | 77 { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // This stylesheet resource did conflict with another resource and was | 173 // This stylesheet resource did conflict with another resource and was |
| 179 // not added to the cache. | 174 // not added to the cache. |
| 180 setParsedStyleSheetCache(nullptr); | 175 setParsedStyleSheetCache(nullptr); |
| 181 return; | 176 return; |
| 182 } | 177 } |
| 183 setParsedStyleSheetCache(sheet); | 178 setParsedStyleSheetCache(sheet); |
| 184 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); | 179 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); |
| 185 } | 180 } |
| 186 | 181 |
| 187 } // namespace blink | 182 } // namespace blink |
| OLD | NEW |