| OLD | NEW |
| 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 "components/upload_list/upload_list.h" | 5 #include "components/upload_list/upload_list.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/thread_task_runner_handle.h" | |
| 18 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
| 18 #include "base/threading/thread_task_runner_handle.h" |
| 19 | 19 |
| 20 UploadList::UploadInfo::UploadInfo(const std::string& upload_id, | 20 UploadList::UploadInfo::UploadInfo(const std::string& upload_id, |
| 21 const base::Time& upload_time, | 21 const base::Time& upload_time, |
| 22 const std::string& local_id, | 22 const std::string& local_id, |
| 23 const base::Time& capture_time) | 23 const base::Time& capture_time) |
| 24 : upload_id(upload_id), upload_time(upload_time), | 24 : upload_id(upload_id), upload_time(upload_time), |
| 25 local_id(local_id), capture_time(capture_time) {} | 25 local_id(local_id), capture_time(capture_time) {} |
| 26 | 26 |
| 27 UploadList::UploadInfo::UploadInfo(const std::string& upload_id, | 27 UploadList::UploadInfo::UploadInfo(const std::string& upload_id, |
| 28 const base::Time& upload_time) | 28 const base::Time& upload_time) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 delegate_->OnUploadListAvailable(); | 115 delegate_->OnUploadListAvailable(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void UploadList::GetUploads(size_t max_count, | 118 void UploadList::GetUploads(size_t max_count, |
| 119 std::vector<UploadInfo>* uploads) { | 119 std::vector<UploadInfo>* uploads) { |
| 120 DCHECK(thread_checker_.CalledOnValidThread()); | 120 DCHECK(thread_checker_.CalledOnValidThread()); |
| 121 std::copy(uploads_.begin(), | 121 std::copy(uploads_.begin(), |
| 122 uploads_.begin() + std::min(uploads_.size(), max_count), | 122 uploads_.begin() + std::min(uploads_.size(), max_count), |
| 123 std::back_inserter(*uploads)); | 123 std::back_inserter(*uploads)); |
| 124 } | 124 } |
| OLD | NEW |