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

Unified Diff: Source/core/inspector/NetworkResourcesData.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, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/xml/XMLHttpRequest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/NetworkResourcesData.cpp
diff --git a/Source/core/inspector/NetworkResourcesData.cpp b/Source/core/inspector/NetworkResourcesData.cpp
index 60c2a8feec6f4f1492c842d4c58afce3fb38a49e..7aaa47a174cddd03701e21077242cdebcdb0a4bb 100644
--- a/Source/core/inspector/NetworkResourcesData.cpp
+++ b/Source/core/inspector/NetworkResourcesData.cpp
@@ -160,18 +160,15 @@ static PassOwnPtr<TextResourceDecoder> createOtherResourceTextDecoder(const Stri
OwnPtr<TextResourceDecoder> decoder;
if (!textEncodingName.isEmpty()) {
decoder = TextResourceDecoder::create("text/plain", textEncodingName);
- } else {
- String mimeTypeLower = mimeType.lower();
- if (DOMImplementation::isXMLMIMEType(mimeTypeLower)) {
- decoder = TextResourceDecoder::create("application/xml");
- decoder->useLenientXMLDecoding();
- } else if (equalIgnoringCase(mimeType, "text/html")) {
- decoder = TextResourceDecoder::create("text/html", "UTF-8");
- } else if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeTypeLower) || DOMImplementation::isJSONMIMEType(mimeTypeLower)) {
- decoder = TextResourceDecoder::create("text/plain", "UTF-8");
- } else if (DOMImplementation::isTextMIMEType(mimeTypeLower)) {
- decoder = TextResourceDecoder::create("text/plain", "ISO-8859-1");
- }
+ } else if (DOMImplementation::isXMLMIMEType(mimeType)) {
+ decoder = TextResourceDecoder::create("application/xml");
+ decoder->useLenientXMLDecoding();
+ } else if (equalIgnoringCase(mimeType, "text/html")) {
+ decoder = TextResourceDecoder::create("text/html", "UTF-8");
+ } else if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType) || DOMImplementation::isJSONMIMEType(mimeType)) {
+ decoder = TextResourceDecoder::create("text/plain", "UTF-8");
+ } else if (DOMImplementation::isTextMIMEType(mimeType)) {
+ decoder = TextResourceDecoder::create("text/plain", "ISO-8859-1");
}
return decoder.release();
}
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/xml/XMLHttpRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698