| 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_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ | 5 #ifndef COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ |
| 6 #define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ | 6 #define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "components/download/internal/config.h" |
| 11 #include "components/download/public/download_service.h" | 13 #include "components/download/public/download_service.h" |
| 12 | 14 |
| 13 namespace download { | 15 namespace download { |
| 14 | 16 |
| 15 struct DownloadParams; | 17 struct DownloadParams; |
| 16 struct SchedulingParams; | 18 struct SchedulingParams; |
| 17 | 19 |
| 18 // The internal implementation of the DownloadService. | 20 // The internal implementation of the DownloadService. |
| 19 class DownloadServiceImpl : public DownloadService { | 21 class DownloadServiceImpl : public DownloadService { |
| 20 public: | 22 public: |
| 21 DownloadServiceImpl(); | 23 DownloadServiceImpl(std::unique_ptr<Configuration> config); |
| 22 ~DownloadServiceImpl() override; | 24 ~DownloadServiceImpl() override; |
| 23 | 25 |
| 24 // DownloadService implementation. | 26 // DownloadService implementation. |
| 25 void StartDownload(const DownloadParams& download_params) override; | 27 void StartDownload(const DownloadParams& download_params) override; |
| 26 void PauseDownload(const std::string& guid) override; | 28 void PauseDownload(const std::string& guid) override; |
| 27 void ResumeDownload(const std::string& guid) override; | 29 void ResumeDownload(const std::string& guid) override; |
| 28 void CancelDownload(const std::string& guid) override; | 30 void CancelDownload(const std::string& guid) override; |
| 29 void ChangeDownloadCriteria(const std::string& guid, | 31 void ChangeDownloadCriteria(const std::string& guid, |
| 30 const SchedulingParams& params) override; | 32 const SchedulingParams& params) override; |
| 31 | 33 |
| 32 private: | 34 private: |
| 35 std::unique_ptr<Configuration> config_; |
| 36 |
| 33 DISALLOW_COPY_AND_ASSIGN(DownloadServiceImpl); | 37 DISALLOW_COPY_AND_ASSIGN(DownloadServiceImpl); |
| 34 }; | 38 }; |
| 35 | 39 |
| 36 } // namespace download | 40 } // namespace download |
| 37 | 41 |
| 38 #endif // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ | 42 #endif // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_ |
| OLD | NEW |