summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_contents.cc
diff options
context:
space:
mode:
authorjnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-21 02:58:09 +0000
committerjnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-21 02:58:09 +0000
commit1a3ebe10ead2ca99d2beb45b9ec65a2863406184 (patch)
treeb1c8b11cc0a32e1f561362ecee1b488bf7d91b15 /chrome/browser/web_contents.cc
parentaef050626d6412bffa292cbfcee23107cadc4b5d (diff)
downloadchromium_src-1a3ebe10ead2ca99d2beb45b9ec65a2863406184.zip
chromium_src-1a3ebe10ead2ca99d2beb45b9ec65a2863406184.tar.gz
chromium_src-1a3ebe10ead2ca99d2beb45b9ec65a2863406184.tar.bz2
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
Diffstat (limited to 'chrome/browser/web_contents.cc')
-rw-r--r--chrome/browser/web_contents.cc8
1 files changed, 4 insertions, 4 deletions
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(