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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp

Issue 2290983003: CSSStyleSheetResource should cache decoded text instead of raw bytes (Closed)
Patch Set: Created 4 years, 3 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) 2008, 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
4 * Copyright (C) 2010 Google Inc. All Rights Reserved. 4 * Copyright (C) 2010 Google Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 : m_preloader(preloader) 244 : m_preloader(preloader)
245 { 245 {
246 DCHECK(resource->getType() == Resource::Type::CSSStyleSheet); 246 DCHECK(resource->getType() == Resource::Type::CSSStyleSheet);
247 setResource(toCSSStyleSheetResource(resource), Resource::DontMarkAsReference d); 247 setResource(toCSSStyleSheetResource(resource), Resource::DontMarkAsReference d);
248 } 248 }
249 249
250 CSSPreloaderResourceClient::~CSSPreloaderResourceClient() 250 CSSPreloaderResourceClient::~CSSPreloaderResourceClient()
251 { 251 {
252 } 252 }
253 253
254 void CSSPreloaderResourceClient::setCSSStyleSheet(const String& href, const KURL & baseURL, const String& charset, const CSSStyleSheetResource*) 254 void CSSPreloaderResourceClient::setCSSStyleSheet(const String& href, const KURL & baseURL, const String& charset, CSSStyleSheetResource*)
255 { 255 {
256 clearResource(); 256 clearResource();
257 } 257 }
258 258
259 // Only attach for one appendData call, as that's where most imports will likely 259 // Only attach for one appendData call, as that's where most imports will likely
260 // be (according to spec). 260 // be (according to spec).
261 void CSSPreloaderResourceClient::didAppendFirstData(const CSSStyleSheetResource* resource) 261 void CSSPreloaderResourceClient::didAppendFirstData(const CSSStyleSheetResource* resource)
262 { 262 {
263 if (m_preloader) 263 if (m_preloader)
264 scanCSS(resource); 264 scanCSS(resource);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 } 302 }
303 303
304 DEFINE_TRACE(CSSPreloaderResourceClient) 304 DEFINE_TRACE(CSSPreloaderResourceClient)
305 { 305 {
306 visitor->trace(m_preloader); 306 visitor->trace(m_preloader);
307 ResourceOwner<CSSStyleSheetResource>::trace(visitor); 307 ResourceOwner<CSSStyleSheetResource>::trace(visitor);
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698