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

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

Issue 2642383003: Replace Resource::Status with ResourceStatus (Closed)
Patch Set: Rebase. Created 3 years, 11 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 const String CSSStyleSheetResource::sheetText( 108 const String CSSStyleSheetResource::sheetText(
109 MIMETypeCheck mimeTypeCheck) const { 109 MIMETypeCheck mimeTypeCheck) const {
110 if (!canUseSheet(mimeTypeCheck)) 110 if (!canUseSheet(mimeTypeCheck))
111 return String(); 111 return String();
112 112
113 // Use cached decoded sheet text when available 113 // Use cached decoded sheet text when available
114 if (!m_decodedSheetText.isNull()) { 114 if (!m_decodedSheetText.isNull()) {
115 // We should have the decoded sheet text cached when the resource is fully 115 // We should have the decoded sheet text cached when the resource is fully
116 // loaded. 116 // loaded.
117 DCHECK_EQ(getStatus(), Resource::Cached); 117 DCHECK_EQ(getStatus(), ResourceStatus::Cached);
118 118
119 return m_decodedSheetText; 119 return m_decodedSheetText;
120 } 120 }
121 121
122 if (!data() || data()->isEmpty()) 122 if (!data() || data()->isEmpty())
123 return String(); 123 return String();
124 124
125 return decodedText(); 125 return decodedText();
126 } 126 }
127 127
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 void CSSStyleSheetResource::updateDecodedSize() { 227 void CSSStyleSheetResource::updateDecodedSize() {
228 size_t decodedSize = m_decodedSheetText.charactersSizeInBytes(); 228 size_t decodedSize = m_decodedSheetText.charactersSizeInBytes();
229 if (m_parsedStyleSheetCache) 229 if (m_parsedStyleSheetCache)
230 decodedSize += m_parsedStyleSheetCache->estimatedSizeInBytes(); 230 decodedSize += m_parsedStyleSheetCache->estimatedSizeInBytes();
231 setDecodedSize(decodedSize); 231 setDecodedSize(decodedSize);
232 } 232 }
233 233
234 } // namespace blink 234 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/ImageLoader.cpp ('k') | third_party/WebKit/Source/core/loader/resource/FontResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698