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

Unified Diff: net/base/data_url.cc

Issue 647883002: git cl format the final third of the net/base directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/base/data_url.cc
diff --git a/net/base/data_url.cc b/net/base/data_url.cc
index 58036c6a369061e6a97c791e728f107da7f8046e..43cf23a98170e43719336fb41f62f7d10ffebcc5 100644
--- a/net/base/data_url.cc
+++ b/net/base/data_url.cc
@@ -20,8 +20,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();
@@ -98,22 +100,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 |
mef 2014/10/10 20:38:17 this is definitely wrong.
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698