From deeb2de14bfbf218494cd1e63142aee945525f32 Mon Sep 17 00:00:00 2001 From: Jeremy Rose Date: Mon, 22 Mar 2021 10:35:11 -0700 Subject: [PATCH] undo changes to WebContentsPreferences::GetPreloadPath to fix mac build --- shell/browser/web_contents_preferences.cc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/shell/browser/web_contents_preferences.cc b/shell/browser/web_contents_preferences.cc index d609da029667..20317bfd6d8a 100644 --- a/shell/browser/web_contents_preferences.cc +++ b/shell/browser/web_contents_preferences.cc @@ -235,24 +235,18 @@ bool WebContentsPreferences::GetPreference(base::StringPiece name, bool WebContentsPreferences::GetPreloadPath(base::FilePath* path) const { DCHECK(path); base::FilePath::StringType 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 (GetAsString(&preference_, options::kPreloadScript, &preload_path)) { + base::FilePath preload(preload_path); 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_str)) { + } else if (GetAsString(&preference_, options::kPreloadURL, &preload_path)) { // Translate to file path if there is "preload-url" option. base::FilePath preload; - if (net::FileURLToFilePath(GURL(preload_path_str), &preload)) { + if (net::FileURLToFilePath(GURL(preload_path), &preload)) { *path = std::move(preload); return true; } else {