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

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

Issue 1989093003: Remove the prefinalizer of Resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp1985033003
Patch Set: Created 4 years, 7 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
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h ('k') | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698