2757472: Reland "Reland "[LSC] Remove base::string16 alias""

2757472
This commit is contained in:
John Kleinschmidt 2021-03-18 15:55:51 -04:00
parent 3b183854ff
commit 2d3c65beca
31 changed files with 200 additions and 152 deletions

View file

@ -235,18 +235,24 @@ bool WebContentsPreferences::GetPreference(base::StringPiece name,
bool WebContentsPreferences::GetPreloadPath(base::FilePath* path) const {
DCHECK(path);
base::FilePath::StringType preload_path;
if (GetAsString(&preference_, options::kPreloadScript, &preload_path)) {
base::FilePath preload(preload_path);
std::u16string preload_path_str;
if (GetAsString(&preference_, options::kPreloadScript, &preload_path_str)) {
#if defined(OS_WIN)
base::FilePath preload(base::UTF16ToWide(preload_path_str));
#else
base::FilePath preload(preload_path_str);
#endif
if (preload.IsAbsolute()) {
*path = std::move(preload);
return true;
} else {
LOG(ERROR) << "preload script must have absolute path.";
}
} else if (GetAsString(&preference_, options::kPreloadURL, &preload_path)) {
} else if (GetAsString(&preference_, options::kPreloadURL,
&preload_path_str)) {
// Translate to file path if there is "preload-url" option.
base::FilePath preload;
if (net::FileURLToFilePath(GURL(preload_path), &preload)) {
if (net::FileURLToFilePath(GURL(preload_path_str), &preload)) {
*path = std::move(preload);
return true;
} else {