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

Unified Diff: net/base/net_util.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « net/base/mime_util_unittest.cc ('k') | net/base/net_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util.cc
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 1f69ee71800b5e7ffeb72f841641993aee8dabeb..f26169ad44120322a37d9b19baa6e1af47b240f7 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -634,7 +634,7 @@ base::string16 FormatViewSourceUrl(const GURL& url,
base::OffsetAdjuster adjuster(&offsets_into_underlying_url);
adjuster.Add(base::OffsetAdjuster::Adjustment(0, kViewSourceLength, 0));
}
- base::string16 result(ASCIIToUTF16(kViewSource) +
+ base::string16 result(base::ASCIIToUTF16(kViewSource) +
FormatUrlWithOffsets(GURL(url_str.substr(kViewSourceLength)), languages,
format_types, unescape_rules, new_parsed, prefix_end,
&offsets_into_underlying_url));
@@ -810,9 +810,9 @@ std::string GetFileNameFromURL(const GURL& url,
referrer_charset.c_str(),
base::OnStringConversionError::FAIL,
&utf16_output)) {
- decoded_filename = UTF16ToUTF8(utf16_output);
+ decoded_filename = base::UTF16ToUTF8(utf16_output);
} else {
- decoded_filename = WideToUTF8(
+ decoded_filename = base::WideToUTF8(
base::SysNativeMBToWide(unescaped_url_filename));
}
}
@@ -857,7 +857,7 @@ bool IsReservedName(const base::FilePath::StringType& filename) {
"lpt5", "lpt6", "lpt7", "lpt8", "lpt9", "clock$"
};
#if defined(OS_WIN)
- std::string filename_lower = StringToLowerASCII(WideToUTF8(filename));
+ std::string filename_lower = StringToLowerASCII(base::WideToUTF8(filename));
#elif defined(OS_POSIX)
std::string filename_lower = StringToLowerASCII(filename);
#endif
@@ -945,11 +945,12 @@ void EnsureSafeExtension(const std::string& mime_type,
bool FilePathToString16(const base::FilePath& path, base::string16* converted) {
#if defined(OS_WIN)
- return WideToUTF16(path.value().c_str(), path.value().size(), converted);
+ return base::WideToUTF16(
+ path.value().c_str(), path.value().size(), converted);
#elif defined(OS_POSIX)
std::string component8 = path.AsUTF8Unsafe();
return !component8.empty() &&
- UTF8ToUTF16(component8.c_str(), component8.size(), converted);
+ base::UTF8ToUTF16(component8.c_str(), component8.size(), converted);
#endif
}
@@ -1152,7 +1153,7 @@ std::string GetDirectoryListingEntry(const base::string16& name,
base::EscapeJSONString(name, true, &result);
result.append(",");
if (raw_bytes.empty()) {
- base::EscapeJSONString(EscapePath(UTF16ToUTF8(name)), true, &result);
+ base::EscapeJSONString(EscapePath(base::UTF16ToUTF8(name)), true, &result);
} else {
base::EscapeJSONString(EscapePath(raw_bytes), true, &result);
}
@@ -1183,13 +1184,13 @@ std::string GetDirectoryListingEntry(const base::string16& name,
}
base::string16 StripWWW(const base::string16& text) {
- const base::string16 www(ASCIIToUTF16("www."));
+ const base::string16 www(base::ASCIIToUTF16("www."));
return StartsWith(text, www, true) ? text.substr(www.length()) : text;
}
base::string16 StripWWWFromHost(const GURL& url) {
DCHECK(url.is_valid());
- return StripWWW(ASCIIToUTF16(url.host()));
+ return StripWWW(base::ASCIIToUTF16(url.host()));
}
bool IsSafePortablePathComponent(const base::FilePath& component) {
@@ -1292,8 +1293,8 @@ base::string16 GetSuggestedFilename(const GURL& url,
base::FilePath::StringType result_str, default_name_str;
#if defined(OS_WIN)
replace_trailing = true;
- result_str = UTF8ToUTF16(filename);
- default_name_str = UTF8ToUTF16(default_name);
+ result_str = base::UTF8ToUTF16(filename);
+ default_name_str = base::UTF8ToUTF16(default_name);
#else
result_str = filename;
default_name_str = default_name;
@@ -1337,7 +1338,7 @@ base::FilePath GenerateFileName(const GURL& url,
base::FilePath generated_name(file_name);
#else
base::FilePath generated_name(
- base::SysWideToNativeMB(UTF16ToWide(file_name)));
+ base::SysWideToNativeMB(base::UTF16ToWide(file_name)));
#endif
#if defined(OS_CHROMEOS)
@@ -1835,7 +1836,7 @@ base::string16 FormatUrlWithOffsets(
// If we need to strip out http do it after the fact. This way we don't need
// to worry about how offset_for_adjustment is interpreted.
- if (omit_http && StartsWith(url_string, ASCIIToUTF16(kHTTP), true)) {
+ if (omit_http && StartsWith(url_string, base::ASCIIToUTF16(kHTTP), true)) {
const size_t kHTTPSize = arraysize(kHTTP) - 1;
url_string = url_string.substr(kHTTPSize);
if (offsets_for_adjustment && !offsets_for_adjustment->empty()) {
« no previous file with comments | « net/base/mime_util_unittest.cc ('k') | net/base/net_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698