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/crash_upload_list.h" | 5 #include "chrome/browser/crash_upload_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/string_split.h" | |
15 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_split.h" |
16 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
17 #include "chrome/browser/crash_upload_list_win.h" | 17 #include "chrome/browser/crash_upload_list_win.h" |
18 #endif | 18 #endif |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
21 | 21 |
22 using content::BrowserThread; | 22 using content::BrowserThread; |
23 | 23 |
24 CrashUploadList::CrashInfo::CrashInfo(const std::string& c, const base::Time& t) | 24 CrashUploadList::CrashInfo::CrashInfo(const std::string& c, const base::Time& t) |
25 : crash_id(c), crash_time(t) {} | 25 : crash_id(c), crash_time(t) {} |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void CrashUploadList::GetUploadedCrashes(unsigned int max_count, | 101 void CrashUploadList::GetUploadedCrashes(unsigned int max_count, |
102 std::vector<CrashInfo>* crashes) { | 102 std::vector<CrashInfo>* crashes) { |
103 std::copy(crashes_.begin(), | 103 std::copy(crashes_.begin(), |
104 crashes_.begin() + std::min<size_t>(crashes_.size(), max_count), | 104 crashes_.begin() + std::min<size_t>(crashes_.size(), max_count), |
105 std::back_inserter(*crashes)); | 105 std::back_inserter(*crashes)); |
106 } | 106 } |
107 | 107 |
108 std::vector<CrashUploadList::CrashInfo>& CrashUploadList::crashes() { | 108 std::vector<CrashUploadList::CrashInfo>& CrashUploadList::crashes() { |
109 return crashes_; | 109 return crashes_; |
110 } | 110 } |
OLD | NEW |