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

Side by Side Diff: chrome/installer/util/uninstall_metrics.cc

Issue 1878313003: Convert //chrome/installer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert decompress.cc in mini_installer. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/installer/util/uninstall_metrics.h" 5 #include "chrome/installer/util/uninstall_metrics.h"
6 6
7 #include <memory>
7 #include <string> 8 #include <string>
8 9
9 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
10 #include "base/json/json_file_value_serializer.h" 11 #include "base/json/json_file_value_serializer.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
15 #include "chrome/installer/util/util_constants.h" 15 #include "chrome/installer/util/util_constants.h"
16 #include "components/metrics/metrics_pref_names.h" 16 #include "components/metrics/metrics_pref_names.h"
17 17
18 namespace installer { 18 namespace installer {
19 19
20 namespace { 20 namespace {
21 21
22 // Given a DictionaryValue containing a set of uninstall metrics, 22 // Given a DictionaryValue containing a set of uninstall metrics,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 return true; 73 return true;
74 } 74 }
75 75
76 bool ExtractUninstallMetricsFromFile(const base::FilePath& file_path, 76 bool ExtractUninstallMetricsFromFile(const base::FilePath& file_path,
77 base::string16* uninstall_metrics_string) { 77 base::string16* uninstall_metrics_string) {
78 JSONFileValueDeserializer json_deserializer(file_path); 78 JSONFileValueDeserializer json_deserializer(file_path);
79 79
80 std::string json_error_string; 80 std::string json_error_string;
81 scoped_ptr<base::Value> root = json_deserializer.Deserialize(NULL, NULL); 81 std::unique_ptr<base::Value> root = json_deserializer.Deserialize(NULL, NULL);
82 if (!root.get()) 82 if (!root.get())
83 return false; 83 return false;
84 84
85 // Preferences should always have a dictionary root. 85 // Preferences should always have a dictionary root.
86 if (!root->IsType(base::Value::TYPE_DICTIONARY)) 86 if (!root->IsType(base::Value::TYPE_DICTIONARY))
87 return false; 87 return false;
88 88
89 return ExtractUninstallMetrics( 89 return ExtractUninstallMetrics(
90 *static_cast<base::DictionaryValue*>(root.get()), 90 *static_cast<base::DictionaryValue*>(root.get()),
91 uninstall_metrics_string); 91 uninstall_metrics_string);
92 } 92 }
93 93
94 } // namespace installer 94 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/util/shell_util_unittest.cc ('k') | chrome/installer/util/uninstall_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698