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

Unified Diff: chrome/browser/ui/webui/cookies_tree_model_util.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble Created 3 years, 8 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
Index: chrome/browser/ui/webui/cookies_tree_model_util.cc
diff --git a/chrome/browser/ui/webui/cookies_tree_model_util.cc b/chrome/browser/ui/webui/cookies_tree_model_util.cc
index 61414033f84a7e5cc59a585eab930af7af48139e..0d9e80aa052a5a8e6525b56bc99e4375e58ad958 100644
--- a/chrome/browser/ui/webui/cookies_tree_model_util.cc
+++ b/chrome/browser/ui/webui/cookies_tree_model_util.cc
@@ -9,6 +9,7 @@
#include <vector>
#include "base/i18n/time_formatting.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -255,14 +256,14 @@ bool CookiesTreeModelUtil::GetCookieTreeNodeDictionary(
dict->SetString(kKeyOrigin, service_worker_info.origin.spec());
dict->SetString(kKeySize,
ui::FormatBytes(service_worker_info.total_size_bytes));
- base::ListValue* scopes = new base::ListValue;
+ auto scopes = base::MakeUnique<base::ListValue>();
for (std::vector<GURL>::const_iterator it =
service_worker_info.scopes.begin();
it != service_worker_info.scopes.end();
++it) {
scopes->AppendString(it->spec());
}
- dict->Set(kKeyScopes, scopes);
+ dict->Set(kKeyScopes, std::move(scopes));
break;
}
case CookieTreeNode::DetailedInfo::TYPE_CACHE_STORAGE: {
@@ -305,7 +306,7 @@ bool CookiesTreeModelUtil::GetCookieTreeNodeDictionary(
const extensions::ExtensionSet* protecting_apps =
node.GetModel()->ExtensionsProtectingNode(node);
if (protecting_apps && !protecting_apps->is_empty()) {
- base::ListValue* app_infos = new base::ListValue;
+ auto app_infos = base::MakeUnique<base::ListValue>();
for (extensions::ExtensionSet::const_iterator it = protecting_apps->begin();
it != protecting_apps->end(); ++it) {
std::unique_ptr<base::DictionaryValue> app_info(
@@ -314,7 +315,7 @@ bool CookiesTreeModelUtil::GetCookieTreeNodeDictionary(
app_info->SetString(kKeyName, (*it)->name());
app_infos->Append(std::move(app_info));
}
- dict->Set(kKeyAppsProtectingThis, app_infos);
+ dict->Set(kKeyAppsProtectingThis, std::move(app_infos));
}
#endif
« no previous file with comments | « chrome/browser/ui/webui/components_ui.cc ('k') | chrome/browser/ui/webui/extensions/extension_loader_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698