Chromium Code Reviews| Index: components/download/internal/config.h |
| diff --git a/components/download/internal/config.h b/components/download/internal/config.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bf503d7dcd57bee78233617c3510733ad7f1cc0a |
| --- /dev/null |
| +++ b/components/download/internal/config.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_ |
| +#define COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "base/time/time.h" |
| + |
| +namespace download { |
| + |
| +// Configuration name for max concurrent downloads. |
| +constexpr char kMaxConcurrentDownloadsConfig[] = "max_concurrent_downloads"; |
| + |
| +// Configuration name for maximum running downloads. |
| +constexpr char kMaxRunningDownloadsConfig[] = "max_running_downloads"; |
| + |
| +// Configuration name for maximum scheduled downloads. |
| +constexpr char kMaxScheduledDownloadsConfig[] = "max_scheduled_downloads"; |
| + |
| +// Configuration name for maximum retry count. |
| +constexpr char kMaxRetryCountConfig[] = "max_retry_count"; |
| + |
| +// Configuration name for file keep alive time. |
| +constexpr char kFileKeepAliveTimeMinutesConfig[] = "file_keep_alive_time"; |
| + |
| +// Download service configuration. |
| +// |
| +// Loaded based on experiment parameters from the server. Use default values if |
| +// no server configuration was detected. |
| +struct Configuration { |
| + public: |
| + // Create the configuration. |
| + 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.
|
| + |
| + // The maximum number of downloads the DownloadService can have currently in |
| + // Active or Paused states. |
| + int max_concurrent_downloads; |
| + |
| + // The maximum number of downloads the DownloadService can have currently in |
| + // only Active state. |
| + int max_running_downloads; |
| + |
| + // The maximum number of downloads that are scheduled but not yet in Active |
| + // state, for each client using the download service. |
| + int max_scheduled_downloads; |
| + |
| + // The maximum number of retries before the download is aborted. |
| + int max_retry_count; |
| + |
| + // The time that the download service will keep the files around before |
| + // deleting them if the client hasn't handle the files. |
| + base::TimeDelta file_keep_alive_time; |
| + |
| + private: |
| + Configuration(); |
|
David Trainor- moved to gerrit
2017/05/05 23:36:29
Leave this public.
xingliu
2017/05/06 00:55:01
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(Configuration); |
| +}; |
| + |
| +} // namespace download |
| + |
| +#endif // COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_ |