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

Unified Diff: net/base/url_util.cc

Issue 1582083002: net: move GetIdentifyFromURL function into url_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: net/base/url_util.cc
diff --git a/net/base/url_util.cc b/net/base/url_util.cc
index d2a86c50016367ab98538976fb7d8103a79a3192..a5818075ca5aa602b03a8f12108cf72fdb7f4ece 100644
--- a/net/base/url_util.cc
+++ b/net/base/url_util.cc
@@ -4,10 +4,7 @@
#include "net/base/url_util.h"
-#include <utility>
-
#include "base/logging.h"
-#include "base/strings/string_piece.h"
#include "net/base/escape.h"
#include "url/gurl.h"
@@ -141,4 +138,13 @@ std::string TrimEndingDot(const base::StringPiece& host) {
return host_trimmed.as_string();
}
+void GetIdentityFromURL(const GURL& url,
+ base::string16* username,
+ base::string16* password) {
+ UnescapeRule::Type flags =
+ UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS;
+ *username = UnescapeAndDecodeUTF8URLComponent(url.username(), flags);
+ *password = UnescapeAndDecodeUTF8URLComponent(url.password(), flags);
+}
+
} // namespace net
« net/base/net_util.h ('K') | « net/base/url_util.h ('k') | net/base/url_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698