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

Unified Diff: chrome/browser/ui/webui/options2/manage_profile_handler.cc

Issue 10825126: Valgrind: Fix a leak in ManageProfileHandler::SendProfileIcons(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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/browser/ui/webui/options2/manage_profile_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options2/manage_profile_handler.cc
===================================================================
--- chrome/browser/ui/webui/options2/manage_profile_handler.cc (revision 149281)
+++ chrome/browser/ui/webui/options2/manage_profile_handler.cc (working copy)
@@ -27,6 +27,13 @@
namespace options2 {
+namespace {
+
+const char kCreateProfileIconGridName[] = "create-profile-icon-grid";
+const char kManageProfileIconGridName[] = "manage-profile-icon-grid";
+
+} // namespace
+
ManageProfileHandler::ManageProfileHandler() {
}
@@ -86,18 +93,22 @@
const content::NotificationDetails& details) {
if (type == chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED) {
SendProfileNames();
- SendProfileIcons(Value::CreateStringValue("manage-profile-icon-grid"));
+ base::StringValue value(kManageProfileIconGridName);
+ SendProfileIcons(value);
} else {
OptionsPageUIHandler::Observe(type, source, details);
}
}
void ManageProfileHandler::RequestDefaultProfileIcons(const ListValue* args) {
- SendProfileIcons(Value::CreateStringValue("manage-profile-icon-grid"));
- SendProfileIcons(Value::CreateStringValue("create-profile-icon-grid"));
+ base::StringValue create_value(kCreateProfileIconGridName);
+ base::StringValue manage_value(kManageProfileIconGridName);
+ SendProfileIcons(manage_value);
+ SendProfileIcons(create_value);
}
-void ManageProfileHandler::SendProfileIcons(base::StringValue* icon_grid) {
+void ManageProfileHandler::SendProfileIcons(
+ const base::StringValue& icon_grid) {
ListValue image_url_list;
// First add the GAIA picture if it's available.
@@ -122,7 +133,7 @@
}
web_ui()->CallJavascriptFunction(
- "ManageProfileOverlay.receiveDefaultProfileIcons", *icon_grid,
+ "ManageProfileOverlay.receiveDefaultProfileIcons", icon_grid,
image_url_list);
}
« no previous file with comments | « chrome/browser/ui/webui/options2/manage_profile_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698