Index: net/base/data_url.cc |
diff --git a/net/base/data_url.cc b/net/base/data_url.cc |
index e7b46cd44ceb5bc144d29ffc99fb4489a1a02eaf..73ede63b46306eb9cc9b0e628831ddf2980e30e7 100644 |
--- a/net/base/data_url.cc |
+++ b/net/base/data_url.cc |
@@ -18,8 +18,10 @@ |
namespace net { |
// static |
-bool DataURL::Parse(const GURL& url, std::string* mime_type, |
- std::string* charset, std::string* data) { |
+bool DataURL::Parse(const GURL& url, |
+ std::string* mime_type, |
+ std::string* charset, |
+ std::string* data) { |
DCHECK(mime_type->empty()); |
DCHECK(charset->empty()); |
std::string::const_iterator begin = url.spec().begin(); |
@@ -83,22 +85,26 @@ bool DataURL::Parse(const GURL& url, std::string* mime_type, |
// could be part of the payload, so don't strip it. |
if (base64_encoded) { |
temp_data = UnescapeURLComponent(temp_data, |
- UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS | |
- UnescapeRule::CONTROL_CHARS); |
+ UnescapeRule::SPACES | |
+ UnescapeRule::URL_SPECIAL_CHARS | |
+ UnescapeRule::CONTROL_CHARS); |
} |
// Strip whitespace. |
- if (base64_encoded || !(mime_type->compare(0, 5, "text/") == 0 || |
- mime_type->find("xml") != std::string::npos)) { |
- temp_data.erase(std::remove_if(temp_data.begin(), temp_data.end(), |
- IsAsciiWhitespace<wchar_t>), |
- temp_data.end()); |
+ if (base64_encoded || |
+ !(mime_type->compare(0, 5, "text/") == 0 || |
+ mime_type->find("xml") != std::string::npos)) { |
+ temp_data.erase( |
+ std::remove_if( |
+ temp_data.begin(), temp_data.end(), IsAsciiWhitespace<wchar_t>), |
+ temp_data.end()); |
} |
if (!base64_encoded) { |
temp_data = UnescapeURLComponent(temp_data, |
- UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS | |
- UnescapeRule::CONTROL_CHARS); |
+ UnescapeRule::SPACES | |
+ UnescapeRule::URL_SPECIAL_CHARS | |
+ UnescapeRule::CONTROL_CHARS); |
} |
if (base64_encoded) { |