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

Side by Side Diff: Source/core/fetch/CSSStyleSheetResource.cpp

Issue 389553002: Refactoring: Make ~CSSStyleSheetResource empty. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/fetch/CSSStyleSheetResource.h ('k') | Source/core/fetch/Resource.h » ('j') | 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 30 matching lines...) Expand all
41 : StyleSheetResource(resourceRequest, CSSStyleSheet, "text/css", charset) 41 : StyleSheetResource(resourceRequest, CSSStyleSheet, "text/css", charset)
42 { 42 {
43 DEFINE_STATIC_LOCAL(const AtomicString, acceptCSS, ("text/css,*/*;q=0.1", At omicString::ConstructFromLiteral)); 43 DEFINE_STATIC_LOCAL(const AtomicString, acceptCSS, ("text/css,*/*;q=0.1", At omicString::ConstructFromLiteral));
44 44
45 // Prefer text/css but accept any type (dell.com serves a stylesheet 45 // Prefer text/css but accept any type (dell.com serves a stylesheet
46 // as text/html; see <http://bugs.webkit.org/show_bug.cgi?id=11451>). 46 // as text/html; see <http://bugs.webkit.org/show_bug.cgi?id=11451>).
47 setAccept(acceptCSS); 47 setAccept(acceptCSS);
48 } 48 }
49 49
50 CSSStyleSheetResource::~CSSStyleSheetResource() 50 CSSStyleSheetResource::~CSSStyleSheetResource()
51 { 51 {
haraken 2014/07/14 07:28:11 Shall we call m_parsedStyleSheetCache.clear() in d
tkent 2014/07/14 08:47:41 Done.
52 }
53
54 void CSSStyleSheetResource::dispose()
55 {
52 if (m_parsedStyleSheetCache) 56 if (m_parsedStyleSheetCache)
53 m_parsedStyleSheetCache->removedFromMemoryCache(); 57 m_parsedStyleSheetCache->removedFromMemoryCache();
54 } 58 }
55 59
56 void CSSStyleSheetResource::didAddClient(ResourceClient* c) 60 void CSSStyleSheetResource::didAddClient(ResourceClient* c)
57 { 61 {
58 ASSERT(c->resourceClientType() == StyleSheetResourceClient::expectedType()); 62 ASSERT(c->resourceClientType() == StyleSheetResourceClient::expectedType());
59 // Resource::didAddClient() must be before setCSSStyleSheet(), 63 // Resource::didAddClient() must be before setCSSStyleSheet(),
60 // because setCSSStyleSheet() may cause scripts to be executed, which could destroy 'c' if it is an instance of HTMLLinkElement. 64 // because setCSSStyleSheet() may cause scripts to be executed, which could destroy 'c' if it is an instance of HTMLLinkElement.
61 // see the comment of HTMLLinkElement::setCSSStyleSheet. 65 // see the comment of HTMLLinkElement::setCSSStyleSheet.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 164
161 if (m_parsedStyleSheetCache) 165 if (m_parsedStyleSheetCache)
162 m_parsedStyleSheetCache->removedFromMemoryCache(); 166 m_parsedStyleSheetCache->removedFromMemoryCache();
163 m_parsedStyleSheetCache = sheet; 167 m_parsedStyleSheetCache = sheet;
164 m_parsedStyleSheetCache->addedToMemoryCache(); 168 m_parsedStyleSheetCache->addedToMemoryCache();
165 169
166 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); 170 setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes());
167 } 171 }
168 172
169 } 173 }
OLDNEW
« no previous file with comments | « Source/core/fetch/CSSStyleSheetResource.h ('k') | Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698