| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_ | 5 #ifndef COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_ |
| 6 #define COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_ | 6 #define COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_ |
| 7 | 7 |
| 8 #include <map> |
| 9 #include <memory> |
| 10 |
| 11 #include "components/download/public/client.h" |
| 12 |
| 8 namespace download { | 13 namespace download { |
| 9 | 14 |
| 10 // A list of all clients that are able to make download requests through the | 15 // A list of all clients that are able to make download requests through the |
| 11 // DownloadService. | 16 // DownloadService. |
| 12 // To add a new client, update the metric DownloadService.DownloadClients in | 17 // To add a new client, update the metric DownloadService.DownloadClients in |
| 13 // histograms.xml and make sure to keep this list in sync. Additions should be | 18 // histograms.xml and make sure to keep this list in sync. Additions should be |
| 14 // treated as APPEND ONLY to make sure to keep both UMA metric semantics correct | 19 // treated as APPEND ONLY to make sure to keep both UMA metric semantics correct |
| 15 // but also to make sure the underlying database properly associates each | 20 // but also to make sure the underlying database properly associates each |
| 16 // download with the right client. | 21 // download with the right client. |
| 17 enum class DownloadClient { | 22 enum class DownloadClient { |
| 18 // Represents an uninitialized DownloadClient variable. | 23 // Represents an uninitialized DownloadClient variable. |
| 19 INVALID = 0, | 24 INVALID = 0, |
| 20 | 25 |
| 21 // Test client values. Meant to be used by the testing framework and not | 26 // Test client values. Meant to be used by the testing framework and not |
| 22 // production code. Callers will be unable to access the DownloadService with | 27 // production code. Callers will be unable to access the DownloadService with |
| 23 // these test APIs. | 28 // these test APIs. |
| 24 TEST = 1, | 29 TEST = 1, |
| 25 | 30 |
| 26 OFFLINE_PAGE_PREFETCH = 2, | 31 OFFLINE_PAGE_PREFETCH = 2, |
| 27 | 32 |
| 28 BOUNDARY = 3, | 33 BOUNDARY = 3, |
| 29 }; | 34 }; |
| 30 | 35 |
| 36 using DownloadClientMap = std::map<DownloadClient, std::unique_ptr<Client>>; |
| 37 |
| 31 } // namespace download | 38 } // namespace download |
| 32 | 39 |
| 33 #endif // COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_ | 40 #endif // COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_ |
| OLD | NEW |