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

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: add dcheck 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
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (hasZeroSize) { 223 if (hasZeroSize) {
224 *result = ""; 224 *result = "";
225 *base64Encoded = false; 225 *base64Encoded = false;
226 return true; 226 return true;
227 } 227 }
228 228
229 DCHECK(cachedResource); 229 DCHECK(cachedResource);
230 switch (cachedResource->getType()) { 230 switch (cachedResource->getType()) {
231 case Resource::CSSStyleSheet: 231 case Resource::CSSStyleSheet:
232 maybeEncodeTextContent( 232 maybeEncodeTextContent(
233 toCSSStyleSheetResource(cachedResource)->sheetText(), 233 toCSSStyleSheetResource(cachedResource)
234 ->sheetText(CSSStyleSheetResource::MIMETypeCheck::Lax),
234 cachedResource->resourceBuffer(), result, base64Encoded); 235 cachedResource->resourceBuffer(), result, base64Encoded);
235 return true; 236 return true;
236 case Resource::Script: 237 case Resource::Script:
237 maybeEncodeTextContent( 238 maybeEncodeTextContent(
238 cachedResource->resourceBuffer() 239 cachedResource->resourceBuffer()
239 ? toScriptResource(cachedResource)->decodedText() 240 ? toScriptResource(cachedResource)->decodedText()
240 : toScriptResource(cachedResource)->script(), 241 : toScriptResource(cachedResource)->script(),
241 cachedResource->resourceBuffer(), result, base64Encoded); 242 cachedResource->resourceBuffer(), result, base64Encoded);
242 return true; 243 return true;
243 default: 244 default:
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 host->settings().setBlockedMainThreadEventsWarningThreshold(threshold); 854 host->settings().setBlockedMainThreadEventsWarningThreshold(threshold);
854 } 855 }
855 856
856 DEFINE_TRACE(InspectorPageAgent) { 857 DEFINE_TRACE(InspectorPageAgent) {
857 visitor->trace(m_inspectedFrames); 858 visitor->trace(m_inspectedFrames);
858 visitor->trace(m_inspectorResourceContentLoader); 859 visitor->trace(m_inspectorResourceContentLoader);
859 InspectorBaseAgent::trace(visitor); 860 InspectorBaseAgent::trace(visitor);
860 } 861 }
861 862
862 } // namespace blink 863 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698