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); |