Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: content/browser/webui/web_ui_message_handler.cc

Issue 10824033: Coverity: Fix several pass-by-values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win build fix. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/chrome_process_util.cc ('k') | content/public/browser/web_ui_message_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_message_handler.cc
diff --git a/content/browser/webui/web_ui_message_handler.cc b/content/browser/webui/web_ui_message_handler.cc
index bf2d391003e941365eca02a9082c833711782dec..7e7e3eaf371612c283257c320060502479430026 100644
--- a/content/browser/webui/web_ui_message_handler.cc
+++ b/content/browser/webui/web_ui_message_handler.cc
@@ -14,21 +14,21 @@
namespace content {
void WebUIMessageHandler::SetURLAndTitle(DictionaryValue* dictionary,
- string16 title,
+ const string16& title,
const GURL& gurl) {
dictionary->SetString("url", gurl.spec());
bool using_url_as_the_title = false;
+ string16 title_to_set(title);
if (title.empty()) {
using_url_as_the_title = true;
- title = UTF8ToUTF16(gurl.spec());
+ title_to_set = UTF8ToUTF16(gurl.spec());
}
// Since the title can contain BiDi text, we need to mark the text as either
// RTL or LTR, depending on the characters in the string. If we use the URL
// as the title, we mark the title as LTR since URLs are always treated as
// left to right strings.
- string16 title_to_set(title);
if (base::i18n::IsRTL()) {
if (using_url_as_the_title) {
base::i18n::WrapStringWithLTRFormatting(&title_to_set);
« no previous file with comments | « chrome/test/base/chrome_process_util.cc ('k') | content/public/browser/web_ui_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698