Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Side by Side Diff: components/download/internal/config.h

Issue 2866483002: Configuration for download service. (Closed)
Patch Set: Fix protection header comment. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 <stddef.h>
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 Configuration();
36
37 // The maximum number of downloads the DownloadService can have currently in
38 // Active or Paused states.
39 int max_concurrent_downloads;
40
41 // The maximum number of downloads the DownloadService can have currently in
42 // only Active state.
43 int max_running_downloads;
44
45 // The maximum number of downloads that are scheduled but not yet in Active
46 // state, for each client using the download service.
47 int max_scheduled_downloads;
48
49 // The maximum number of retries before the download is aborted.
50 int max_retry_count;
51
52 // The time that the download service will keep the files around before
53 // deleting them if the client hasn't handle the files.
54 base::TimeDelta file_keep_alive_time;
55
56 private:
57 DISALLOW_COPY_AND_ASSIGN(Configuration);
58 };
59
60 } // namespace download
61
62 #endif // COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698