summaryrefslogtreecommitdiffstats
path: root/net/base/net_util.cc
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 16:44:02 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 16:44:02 +0000
commit26b1c610386a165d276383bfafe99e14f4326ccf (patch)
tree6643516152f29cfb006cd686590129204012f31e /net/base/net_util.cc
parent9b40b28c0598ca9fa968e69b5da4be8c2d16f115 (diff)
downloadchromium_src-26b1c610386a165d276383bfafe99e14f4326ccf.zip
chromium_src-26b1c610386a165d276383bfafe99e14f4326ccf.tar.gz
chromium_src-26b1c610386a165d276383bfafe99e14f4326ccf.tar.bz2
Provide a wstring-free version of FormatUrl(), part 1.
I haven't converted the code yet -- the new version just calls the old (wstring) version and does conversions. But I converted the unit test, so that when I do convert the code I'll know it works correctly. BUG=23581 TEST=unit test Review URL: http://codereview.chromium.org/3152048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57336 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.cc')
-rw-r--r--net/base/net_util.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index d0b034b..202f5fc 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -1621,6 +1621,19 @@ std::wstring FormatUrl(const GURL& url,
return url_string;
}
+// TODO(viettrungluu): convert the code in wstring version to this form.
+string16 FormatUrl(const GURL& url,
+ const std::string& languages,
+ FormatUrlTypes format_types,
+ UnescapeRule::Type unescape_rules,
+ url_parse::Parsed* new_parsed,
+ size_t* prefix_end,
+ size_t* offset_for_adjustment) {
+ return WideToUTF16Hack(
+ FormatUrl(url, ASCIIToWide(languages), format_types, unescape_rules,
+ new_parsed, prefix_end, offset_for_adjustment));
+}
+
bool CanStripTrailingSlash(const GURL& url) {
// Omit the path only for standard, non-file URLs with nothing but "/" after
// the hostname.