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

Side by Side Diff: chrome/browser/ui/webui/cookies_tree_model_util.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/components_ui.cc ('k') | chrome/browser/ui/webui/flash_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" 5 #include "chrome/browser/ui/webui/cookies_tree_model_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 break; 302 break;
303 } 303 }
304 304
305 #if defined(ENABLE_EXTENSIONS) 305 #if defined(ENABLE_EXTENSIONS)
306 const extensions::ExtensionSet* protecting_apps = 306 const extensions::ExtensionSet* protecting_apps =
307 node.GetModel()->ExtensionsProtectingNode(node); 307 node.GetModel()->ExtensionsProtectingNode(node);
308 if (protecting_apps && !protecting_apps->is_empty()) { 308 if (protecting_apps && !protecting_apps->is_empty()) {
309 base::ListValue* app_infos = new base::ListValue; 309 base::ListValue* app_infos = new base::ListValue;
310 for (extensions::ExtensionSet::const_iterator it = protecting_apps->begin(); 310 for (extensions::ExtensionSet::const_iterator it = protecting_apps->begin();
311 it != protecting_apps->end(); ++it) { 311 it != protecting_apps->end(); ++it) {
312 base::DictionaryValue* app_info = new base::DictionaryValue(); 312 std::unique_ptr<base::DictionaryValue> app_info(
313 new base::DictionaryValue());
313 app_info->SetString(kKeyId, (*it)->id()); 314 app_info->SetString(kKeyId, (*it)->id());
314 app_info->SetString(kKeyName, (*it)->name()); 315 app_info->SetString(kKeyName, (*it)->name());
315 app_infos->Append(app_info); 316 app_infos->Append(std::move(app_info));
316 } 317 }
317 dict->Set(kKeyAppsProtectingThis, app_infos); 318 dict->Set(kKeyAppsProtectingThis, app_infos);
318 } 319 }
319 #endif 320 #endif
320 321
321 return true; 322 return true;
322 } 323 }
323 324
324 void CookiesTreeModelUtil::GetChildNodeList(const CookieTreeNode* parent, 325 void CookiesTreeModelUtil::GetChildNodeList(const CookieTreeNode* parent,
325 int start, 326 int start,
(...skipping 24 matching lines...) Expand all
350 child = id_map_.Lookup(node_id); 351 child = id_map_.Lookup(node_id);
351 child_index = parent->GetIndexOf(child); 352 child_index = parent->GetIndexOf(child);
352 if (child_index == -1) 353 if (child_index == -1)
353 break; 354 break;
354 355
355 parent = child; 356 parent = child;
356 } 357 }
357 358
358 return child_index >= 0 ? child : NULL; 359 return child_index >= 0 ? child : NULL;
359 } 360 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/components_ui.cc ('k') | chrome/browser/ui/webui/flash_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698