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_CONFIG_H_ | |
6 #define COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/time/time.h" | |
12 | |
13 namespace download { | |
14 | |
15 // Configuration name for max concurrent downloads. | |
16 constexpr char kMaxConcurrentDownloadsConfig[] = "max_concurrent_downloads"; | |
17 | |
18 // Configuration name for maximum running downloads. | |
19 constexpr char kMaxRunningDownloadsConfig[] = "max_running_downloads"; | |
20 | |
21 // Configuration name for maximum scheduled downloads. | |
22 constexpr char kMaxScheduledDownloadsConfig[] = "max_scheduled_downloads"; | |
23 | |
24 // Configuration name for maximum retry count. | |
25 constexpr char kMaxRetryCountConfig[] = "max_retry_count"; | |
26 | |
27 // Configuration name for file keep alive time. | |
28 constexpr char kFileKeepAliveTimeMinutesConfig[] = "file_keep_alive_time"; | |
29 | |
30 // Download service configuration. | |
31 // | |
32 // Loaded based on experiment parameters from the server. Use default values if | |
33 // no server configuration was detected. | |
34 struct Configuration { | |
35 public: | |
36 // Create the configuration. | |
37 static std::unique_ptr<Configuration> Create(); | |
David Trainor- moved to gerrit
2017/05/05 23:36:28
CreateFromFinch?
xingliu
2017/05/06 00:55:01
Done.
| |
38 | |
39 // The maximum number of downloads the DownloadService can have currently in | |
40 // Active or Paused states. | |
41 int max_concurrent_downloads; | |
42 | |
43 // The maximum number of downloads the DownloadService can have currently in | |
44 // only Active state. | |
45 int max_running_downloads; | |
46 | |
47 // The maximum number of downloads that are scheduled but not yet in Active | |
48 // state, for each client using the download service. | |
49 int max_scheduled_downloads; | |
50 | |
51 // The maximum number of retries before the download is aborted. | |
52 int max_retry_count; | |
53 | |
54 // The time that the download service will keep the files around before | |
55 // deleting them if the client hasn't handle the files. | |
56 base::TimeDelta file_keep_alive_time; | |
57 | |
58 private: | |
59 Configuration(); | |
David Trainor- moved to gerrit
2017/05/05 23:36:29
Leave this public.
xingliu
2017/05/06 00:55:01
Done.
| |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(Configuration); | |
62 }; | |
63 | |
64 } // namespace download | |
65 | |
66 #endif // COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_ | |
OLD | NEW |