| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_UTILS_H_ |
| 6 #define COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_UTILS_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <set> |
| 10 #include <string> |
| 11 #include <vector> |
| 12 |
| 13 #include "components/download/public/clients.h" |
| 14 |
| 15 namespace download { |
| 16 |
| 17 struct Entry; |
| 18 |
| 19 namespace util { |
| 20 |
| 21 // Helper method to return the number of Entry objects in |entries| are |
| 22 // associated with |client|. |
| 23 uint32_t GetNumberOfEntriesForClient(DownloadClient client, |
| 24 const std::vector<Entry*>& entries); |
| 25 |
| 26 // Effectively runs a map reduce to turn a list of Entry objects into a map of |
| 27 // [Client Id] -> List of entries. Any Entry in |entries| that does not have a |
| 28 // matching DownloadClient in |clients| will be put in the |
| 29 // DownloadClient::INVALID bucket. |
| 30 std::map<DownloadClient, std::vector<std::string>> MapEntriesToClients( |
| 31 const std::set<DownloadClient>& clients, |
| 32 const std::vector<Entry*>& entries); |
| 33 |
| 34 } // namespace util |
| 35 } // namespace download |
| 36 |
| 37 #endif // COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_UTILS_H_ |
| OLD | NEW |