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

Unified Diff: Source/core/xml/XMLHttpRequest.h

Issue 450103003: Refactor MIME type related methods in XHR for readability (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « no previous file | Source/core/xml/XMLHttpRequest.cpp » ('j') | Source/core/xml/XMLHttpRequest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XMLHttpRequest.h
diff --git a/Source/core/xml/XMLHttpRequest.h b/Source/core/xml/XMLHttpRequest.h
index d2060c8c27ee07eae3983a779c186437975e60f5..0a5a3e9e04223da42465d1a74d24bc4d029d1ece 100644
--- a/Source/core/xml/XMLHttpRequest.h
+++ b/Source/core/xml/XMLHttpRequest.h
@@ -160,7 +160,18 @@ private:
virtual void didFail(const ResourceError&) OVERRIDE;
virtual void didFailRedirectCheck() OVERRIDE;
- AtomicString responseMIMEType() const;
+ // Returns the MIME type part of m_mimeTypeOverride if present and
+ // successfully parsed, or returns one of the "Content-Type" header value
+ // of the received response.
+ //
+ // This method is named after the term "final MIME type" defined in the
+ // spec but doesn't convert the result to ASCII lowercase as specified in
+ // the spec. Must be lowered later or compared using case insensitive
+ // comparison functions if required.
+ AtomicString finalMIMEType() const;
sof 2014/08/11 12:19:38 The term "final MIME type" is a relatively obscure
tyoshino (SeeGerritForStatus) 2014/08/11 13:10:46 OK. Fixed
+ // The same as finalMIMEType() but fallbacks to "text/xml" if
+ // finalMIMEType() returns an empty string.
+ AtomicString finalMIMETypeWithFallback() const;
bool responseIsXML() const;
PassOwnPtr<TextResourceDecoder> createDecoder() const;
@@ -212,6 +223,8 @@ private:
KURL m_url;
AtomicString m_method;
HTTPHeaderMap m_requestHeaders;
+ // Not converted to ASCII lowercase. Must be lowered later or compared
+ // using case insensitive comparison functions if needed.
AtomicString m_mimeTypeOverride;
unsigned long m_timeoutMilliseconds;
RefPtrWillBeMember<Blob> m_responseBlob;
@@ -221,7 +234,7 @@ private:
State m_state;
ResourceResponse m_response;
- String m_responseEncoding;
+ String m_finalCharset;
sof 2014/08/11 12:19:38 Same comment re: name -- m_finalResponseCharset?
tyoshino (SeeGerritForStatus) 2014/08/11 13:10:46 Done
OwnPtr<TextResourceDecoder> m_decoder;
« no previous file with comments | « no previous file | Source/core/xml/XMLHttpRequest.cpp » ('j') | Source/core/xml/XMLHttpRequest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698