| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 ASSERT(!m_parsedStyleSheetCache); | 53 ASSERT(!m_parsedStyleSheetCache); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void CSSStyleSheetResource::dispose() | 56 void CSSStyleSheetResource::dispose() |
| 57 { | 57 { |
| 58 if (m_parsedStyleSheetCache) | 58 if (m_parsedStyleSheetCache) |
| 59 m_parsedStyleSheetCache->removedFromMemoryCache(); | 59 m_parsedStyleSheetCache->removedFromMemoryCache(); |
| 60 m_parsedStyleSheetCache.clear(); | 60 m_parsedStyleSheetCache.clear(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void CSSStyleSheetResource::trace(Visitor* visitor) |
| 64 { |
| 65 visitor->trace(m_parsedStyleSheetCache); |
| 66 StyleSheetResource::trace(visitor); |
| 67 } |
| 68 |
| 63 void CSSStyleSheetResource::didAddClient(ResourceClient* c) | 69 void CSSStyleSheetResource::didAddClient(ResourceClient* c) |
| 64 { | 70 { |
| 65 ASSERT(c->resourceClientType() == StyleSheetResourceClient::expectedType()); | 71 ASSERT(c->resourceClientType() == StyleSheetResourceClient::expectedType()); |
| 66 // Resource::didAddClient() must be before setCSSStyleSheet(), | 72 // Resource::didAddClient() must be before setCSSStyleSheet(), |
| 67 // because setCSSStyleSheet() may cause scripts to be executed, which could
destroy 'c' if it is an instance of HTMLLinkElement. | 73 // because setCSSStyleSheet() may cause scripts to be executed, which could
destroy 'c' if it is an instance of HTMLLinkElement. |
| 68 // see the comment of HTMLLinkElement::setCSSStyleSheet. | 74 // see the comment of HTMLLinkElement::setCSSStyleSheet. |
| 69 Resource::didAddClient(c); | 75 Resource::didAddClient(c); |
| 70 | 76 |
| 71 if (!isLoading()) | 77 if (!isLoading()) |
| 72 static_cast<StyleSheetResourceClient*>(c)->setCSSStyleSheet(m_resourceRe
quest.url(), m_response.url(), encoding(), this); | 78 static_cast<StyleSheetResourceClient*>(c)->setCSSStyleSheet(m_resourceRe
quest.url(), m_response.url(), encoding(), this); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 173 |
| 168 if (m_parsedStyleSheetCache) | 174 if (m_parsedStyleSheetCache) |
| 169 m_parsedStyleSheetCache->removedFromMemoryCache(); | 175 m_parsedStyleSheetCache->removedFromMemoryCache(); |
| 170 m_parsedStyleSheetCache = sheet; | 176 m_parsedStyleSheetCache = sheet; |
| 171 m_parsedStyleSheetCache->addedToMemoryCache(); | 177 m_parsedStyleSheetCache->addedToMemoryCache(); |
| 172 | 178 |
| 173 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); | 179 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); |
| 174 } | 180 } |
| 175 | 181 |
| 176 } | 182 } |
| OLD | NEW |