From 1a3ebe10ead2ca99d2beb45b9ec65a2863406184 Mon Sep 17 00:00:00 2001 From: "jnd@google.com" Date: Thu, 21 Aug 2008 02:58:09 +0000 Subject: As Brett pointed it out, We normally use 8-bit for encoding names since they're always ASCII. Plus, wstrings will also be 32-bit characters on Linux and Mac, which is expensive. So I make this CL by using std::string instead of std::wstring every time you have an encoding name. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1144 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/web_contents.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chrome/browser/web_contents.cc') diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc index 79593c9..ccaf94d 100644 --- a/chrome/browser/web_contents.cc +++ b/chrome/browser/web_contents.cc @@ -757,7 +757,7 @@ void WebContents::AlterTextSize(text_zoom::TextSize size) { // TODO(creis): should this be propagated to other and future RVHs? } -void WebContents::SetPageEncoding(const std::wstring& encoding_name) { +void WebContents::SetPageEncoding(const std::string& encoding_name) { render_view_host()->SetPageEncoding(encoding_name); // TODO(creis): should this be propagated to other and future RVHs? } @@ -1729,7 +1729,7 @@ void WebContents::UpdateTitle(RenderViewHost* rvh, void WebContents::UpdateEncoding(RenderViewHost* render_view_host, - const std::wstring& encoding_name) { + const std::string& encoding_name) { SetEncoding(encoding_name); } @@ -2170,9 +2170,9 @@ WebPreferences WebContents::GetWebkitPrefs() { // webkit/glue/webpreferences.h for more details. // Make sure we will set the default_encoding with canonical encoding name. - web_prefs.default_encoding = + web_prefs.default_encoding = UTF8ToWide( CharacterEncoding::GetCanonicalEncodingNameByAliasName( - web_prefs.default_encoding); + WideToUTF8(web_prefs.default_encoding))); if (web_prefs.default_encoding.empty()) { prefs->ClearPref(prefs::kDefaultCharset); web_prefs.default_encoding = prefs->GetString( -- cgit v1.1