diff options
author | jnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-21 02:58:09 +0000 |
---|---|---|
committer | jnd@google.com <jnd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-21 02:58:09 +0000 |
commit | 1a3ebe10ead2ca99d2beb45b9ec65a2863406184 (patch) | |
tree | b1c8b11cc0a32e1f561362ecee1b488bf7d91b15 /chrome/renderer | |
parent | aef050626d6412bffa292cbfcee23107cadc4b5d (diff) | |
download | chromium_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/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 7153ed2..41b6ab0 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1074,7 +1074,7 @@ void RenderView::UpdateTitle(WebFrame* frame, const std::wstring& title) { } void RenderView::UpdateEncoding(WebFrame* frame, - const std::wstring& encoding_name) { + const std::string& encoding_name) { // Only update main frame's encoding_name. if (webview()->GetMainFrame() == frame && last_encoding_name_ != encoding_name) { @@ -1816,7 +1816,7 @@ void RenderView::ShowContextMenu(WebView* webview, const std::wstring& selection_text, const std::wstring& misspelled_word, int edit_flags, - const std::wstring& frame_encoding) { + const std::string& frame_encoding) { ViewHostMsg_ContextMenu_Params params; params.type = type; params.x = x; @@ -2186,7 +2186,7 @@ void RenderView::OnAlterTextSize(int size) { } } -void RenderView::OnSetPageEncoding(const std::wstring& encoding_name) { +void RenderView::OnSetPageEncoding(const std::string& encoding_name) { webview()->SetPageEncoding(encoding_name); } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index b94f849..cecebaa 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -232,7 +232,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, const std::wstring& selection_text, const std::wstring& misspelled_word, int edit_flags, - const std::wstring& frame_encoding); + const std::string& frame_encoding); virtual void StartDragging(WebView* webview, const WebDropData& drag_data); @@ -336,7 +336,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, // c) function:DidFinishDocumentLoadForFrame. When this function is // called, that means we have got whole html page. In here we should // finally get right encoding of page. - void UpdateEncoding(WebFrame* frame, const std::wstring& encoding_name); + void UpdateEncoding(WebFrame* frame, const std::string& encoding_name); // Captures the thumbnail and text contents for indexing for the given load // ID. If the view's load ID is different than the parameter, this call is @@ -398,7 +398,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, void OnCancelDownload(int32 download_id); void OnFind(const FindInPageRequest& request); void OnAlterTextSize(int size); - void OnSetPageEncoding(const std::wstring& encoding_name); + void OnSetPageEncoding(const std::string& encoding_name); void OnGetAllSavableResourceLinksForCurrentPage(const GURL& page_url); void OnGetSerializedHtmlDataForCurrentPageWithLocalLinks( const std::vector<std::wstring>& links, @@ -524,7 +524,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, ExternalHostBindings external_host_bindings_; // The last gotten main frame's encoding. - std::wstring last_encoding_name_; + std::string last_encoding_name_; // The URL we think the user's mouse is hovering over. We use this to // determine if we want to send a new one (we do not need to send |