OLD | NEW |
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/chromeos/system_logs/lsb_release_log_source.h" | 5 #include "chrome/browser/chromeos/system_logs/lsb_release_log_source.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include <memory> |
| 8 |
8 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
9 | 10 |
10 namespace system_logs { | 11 namespace system_logs { |
11 | 12 |
12 LsbReleaseLogSource::LsbReleaseLogSource() : SystemLogsSource("LsbRelease") { | 13 LsbReleaseLogSource::LsbReleaseLogSource() : SystemLogsSource("LsbRelease") { |
13 } | 14 } |
14 | 15 |
15 LsbReleaseLogSource::~LsbReleaseLogSource() { | 16 LsbReleaseLogSource::~LsbReleaseLogSource() { |
16 } | 17 } |
17 | 18 |
18 void LsbReleaseLogSource::Fetch(const SysLogsSourceCallback& callback) { | 19 void LsbReleaseLogSource::Fetch(const SysLogsSourceCallback& callback) { |
19 DCHECK(!callback.is_null()); | 20 DCHECK(!callback.is_null()); |
20 scoped_ptr<SystemLogsResponse> response(new SystemLogsResponse); | 21 std::unique_ptr<SystemLogsResponse> response(new SystemLogsResponse); |
21 const base::SysInfo::LsbReleaseMap& lsb_map = | 22 const base::SysInfo::LsbReleaseMap& lsb_map = |
22 base::SysInfo::GetLsbReleaseMap(); | 23 base::SysInfo::GetLsbReleaseMap(); |
23 for (base::SysInfo::LsbReleaseMap::const_iterator iter = lsb_map.begin(); | 24 for (base::SysInfo::LsbReleaseMap::const_iterator iter = lsb_map.begin(); |
24 iter != lsb_map.end(); ++iter) { | 25 iter != lsb_map.end(); ++iter) { |
25 (*response)[iter->first] = iter->second; | 26 (*response)[iter->first] = iter->second; |
26 } | 27 } |
27 callback.Run(response.get()); | 28 callback.Run(response.get()); |
28 } | 29 } |
29 | 30 |
30 } // namespace system_logs | 31 } // namespace system_logs |
OLD | NEW |