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

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

Issue 122743002: MIME type predicates and case-insensitive matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplify check for empty +xml subtype Created 6 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
« no previous file with comments | « Source/core/dom/ScriptLoader.cpp ('k') | Source/core/inspector/NetworkResourcesData.cpp » ('j') | 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 static bool hasTextContent(Resource* cachedResource) 159 static bool hasTextContent(Resource* cachedResource)
160 { 160 {
161 InspectorPageAgent::ResourceType type = InspectorPageAgent::cachedResourceTy pe(*cachedResource); 161 InspectorPageAgent::ResourceType type = InspectorPageAgent::cachedResourceTy pe(*cachedResource);
162 return type == InspectorPageAgent::DocumentResource || type == InspectorPage Agent::StylesheetResource || type == InspectorPageAgent::ScriptResource || type == InspectorPageAgent::XHRResource; 162 return type == InspectorPageAgent::DocumentResource || type == InspectorPage Agent::StylesheetResource || type == InspectorPageAgent::ScriptResource || type == InspectorPageAgent::XHRResource;
163 } 163 }
164 164
165 static PassOwnPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeTy pe, const String& textEncodingName) 165 static PassOwnPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeTy pe, const String& textEncodingName)
166 { 166 {
167 if (!textEncodingName.isEmpty()) 167 if (!textEncodingName.isEmpty())
168 return TextResourceDecoder::create("text/plain", textEncodingName); 168 return TextResourceDecoder::create("text/plain", textEncodingName);
169 if (DOMImplementation::isXMLMIMEType(mimeType.lower())) { 169 if (DOMImplementation::isXMLMIMEType(mimeType)) {
170 OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("appli cation/xml"); 170 OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("appli cation/xml");
171 decoder->useLenientXMLDecoding(); 171 decoder->useLenientXMLDecoding();
172 return decoder.release(); 172 return decoder.release();
173 } 173 }
174 if (equalIgnoringCase(mimeType, "text/html")) 174 if (equalIgnoringCase(mimeType, "text/html"))
175 return TextResourceDecoder::create("text/html", "UTF-8"); 175 return TextResourceDecoder::create("text/html", "UTF-8");
176 return TextResourceDecoder::create("text/plain", "UTF-8"); 176 return TextResourceDecoder::create("text/plain", "UTF-8");
177 } 177 }
178 178
179 bool InspectorPageAgent::cachedResourceContent(Resource* cachedResource, String* result, bool* base64Encoded) 179 bool InspectorPageAgent::cachedResourceContent(Resource* cachedResource, String* result, bool* base64Encoded)
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 } 1271 }
1272 1272
1273 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1273 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1274 { 1274 {
1275 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1275 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1276 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ; 1276 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid) ;
1277 } 1277 }
1278 1278
1279 } // namespace WebCore 1279 } // namespace WebCore
1280 1280
OLDNEW
« no previous file with comments | « Source/core/dom/ScriptLoader.cpp ('k') | Source/core/inspector/NetworkResourcesData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698