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

Side by Side Diff: chrome/browser/browsing_data/hosted_apps_counter.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/browsing_data/hosted_apps_counter.h" 5 #include "chrome/browser/browsing_data/hosted_apps_counter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 23 matching lines...) Expand all
34 if (extension->is_hosted_app()) 34 if (extension->is_hosted_app())
35 names.push_back(extension->short_name()); 35 names.push_back(extension->short_name());
36 } 36 }
37 37
38 count = names.size(); 38 count = names.size();
39 39
40 // Give the first two names (alphabetically) as examples. 40 // Give the first two names (alphabetically) as examples.
41 std::sort(names.begin(), names.end()); 41 std::sort(names.begin(), names.end());
42 names.resize(std::min<size_t>(2u, names.size())); 42 names.resize(std::min<size_t>(2u, names.size()));
43 43
44 ReportResult(base::WrapUnique(new HostedAppsResult(this, count, names))); 44 ReportResult(base::MakeUnique<HostedAppsResult>(this, count, names));
45 } 45 }
46 46
47 // HostedAppsCounter::HostedAppsResult ----------------------------------------- 47 // HostedAppsCounter::HostedAppsResult -----------------------------------------
48 48
49 HostedAppsCounter::HostedAppsResult::HostedAppsResult( 49 HostedAppsCounter::HostedAppsResult::HostedAppsResult(
50 const HostedAppsCounter* source, 50 const HostedAppsCounter* source,
51 ResultInt num_apps, 51 ResultInt num_apps,
52 const std::vector<std::string>& examples) 52 const std::vector<std::string>& examples)
53 : FinishedResult(source, num_apps), examples_(examples) {} 53 : FinishedResult(source, num_apps), examples_(examples) {}
54 54
55 HostedAppsCounter::HostedAppsResult::~HostedAppsResult() {} 55 HostedAppsCounter::HostedAppsResult::~HostedAppsResult() {}
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover_unittest.cc ('k') | chrome/browser/browsing_data/media_licenses_counter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698