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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp

Issue 2290983003: CSSStyleSheetResource should cache decoded text instead of raw bytes (Closed)
Patch Set: rebased Created 4 years, 2 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 | « third_party/WebKit/Source/core/html/HTMLLinkElement.cpp ('k') | 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 if (hasZeroSize) { 224 if (hasZeroSize) {
225 *result = ""; 225 *result = "";
226 *base64Encoded = false; 226 *base64Encoded = false;
227 return true; 227 return true;
228 } 228 }
229 229
230 DCHECK(cachedResource); 230 DCHECK(cachedResource);
231 switch (cachedResource->getType()) { 231 switch (cachedResource->getType()) {
232 case Resource::CSSStyleSheet: 232 case Resource::CSSStyleSheet:
233 maybeEncodeTextContent( 233 maybeEncodeTextContent(
234 toCSSStyleSheetResource(cachedResource)->sheetText(), 234 toCSSStyleSheetResource(cachedResource)
235 ->sheetText(CSSStyleSheetResource::MIMETypeCheck::Lax),
235 cachedResource->resourceBuffer(), result, base64Encoded); 236 cachedResource->resourceBuffer(), result, base64Encoded);
236 return true; 237 return true;
237 case Resource::Script: 238 case Resource::Script:
238 maybeEncodeTextContent( 239 maybeEncodeTextContent(
239 cachedResource->resourceBuffer() 240 cachedResource->resourceBuffer()
240 ? toScriptResource(cachedResource)->decodedText() 241 ? toScriptResource(cachedResource)->decodedText()
241 : toScriptResource(cachedResource)->script(), 242 : toScriptResource(cachedResource)->script(),
242 cachedResource->resourceBuffer(), result, base64Encoded); 243 cachedResource->resourceBuffer(), result, base64Encoded);
243 return true; 244 return true;
244 default: 245 default:
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 host->settings().setBlockedMainThreadEventsWarningThreshold(threshold); 856 host->settings().setBlockedMainThreadEventsWarningThreshold(threshold);
856 } 857 }
857 858
858 DEFINE_TRACE(InspectorPageAgent) { 859 DEFINE_TRACE(InspectorPageAgent) {
859 visitor->trace(m_inspectedFrames); 860 visitor->trace(m_inspectedFrames);
860 visitor->trace(m_inspectorResourceContentLoader); 861 visitor->trace(m_inspectorResourceContentLoader);
861 InspectorBaseAgent::trace(visitor); 862 InspectorBaseAgent::trace(visitor);
862 } 863 }
863 864
864 } // namespace blink 865 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698