Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp

Issue 10868093: Merge 125292 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 CachedCSSStyleSheet::~CachedCSSStyleSheet() 53 CachedCSSStyleSheet::~CachedCSSStyleSheet()
54 { 54 {
55 if (m_parsedStyleSheetCache) 55 if (m_parsedStyleSheetCache)
56 m_parsedStyleSheetCache->removedFromMemoryCache(); 56 m_parsedStyleSheetCache->removedFromMemoryCache();
57 } 57 }
58 58
59 void CachedCSSStyleSheet::didAddClient(CachedResourceClient* c) 59 void CachedCSSStyleSheet::didAddClient(CachedResourceClient* c)
60 { 60 {
61 ASSERT(c->resourceClientType() == CachedStyleSheetClient::expectedType()); 61 ASSERT(c->resourceClientType() == CachedStyleSheetClient::expectedType());
62 // CachedResource::didAddClient() must be before setCSSStyleSheet(),
63 // because setCSSStyleSheet() may cause scripts to be executed, which could destroy 'c' if it is an instance of HTMLLinkElement.
64 // see the comment of HTMLLinkElement::setCSSStyleSheet.
65 CachedResource::didAddClient(c);
66
62 if (!isLoading()) 67 if (!isLoading())
63 static_cast<CachedStyleSheetClient*>(c)->setCSSStyleSheet(m_resourceRequ est.url(), m_response.url(), m_decoder->encoding().name(), this); 68 static_cast<CachedStyleSheetClient*>(c)->setCSSStyleSheet(m_resourceRequ est.url(), m_response.url(), m_decoder->encoding().name(), this);
64
65 CachedResource::didAddClient(c);
66 } 69 }
67 70
68 void CachedCSSStyleSheet::setEncoding(const String& chs) 71 void CachedCSSStyleSheet::setEncoding(const String& chs)
69 { 72 {
70 m_decoder->setEncoding(chs, TextResourceDecoder::EncodingFromHTTPHeader); 73 m_decoder->setEncoding(chs, TextResourceDecoder::EncodingFromHTTPHeader);
71 } 74 }
72 75
73 String CachedCSSStyleSheet::encoding() const 76 String CachedCSSStyleSheet::encoding() const
74 { 77 {
75 return m_decoder->encoding().name(); 78 return m_decoder->encoding().name();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void CachedCSSStyleSheet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 205 void CachedCSSStyleSheet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
203 { 206 {
204 MemoryClassInfo<CachedCSSStyleSheet> info(memoryObjectInfo, this, MemoryInst rumentation::CachedResourceCSS); 207 MemoryClassInfo<CachedCSSStyleSheet> info(memoryObjectInfo, this, MemoryInst rumentation::CachedResourceCSS);
205 CachedResource::reportMemoryUsage(memoryObjectInfo); 208 CachedResource::reportMemoryUsage(memoryObjectInfo);
206 info.addMember(m_decoder); 209 info.addMember(m_decoder);
207 info.addInstrumentedMember(m_parsedStyleSheetCache); 210 info.addInstrumentedMember(m_parsedStyleSheetCache);
208 info.addMember(m_decodedSheetText); 211 info.addMember(m_decodedSheetText);
209 } 212 }
210 213
211 } 214 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698