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_DRIVER_H_ | 5 #ifndef COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_ |
6 #define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_ | 6 #define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/optional.h" | 10 #include "base/optional.h" |
11 #include "components/download/internal/driver_entry.h" | 11 #include "components/download/internal/driver_entry.h" |
| 12 #include "net/traffic_annotation/network_traffic_annotation.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 class FilePath; | 15 class FilePath; |
15 } // namespace base | 16 } // namespace base |
16 | 17 |
17 namespace download { | 18 namespace download { |
18 | 19 |
19 struct DownloadParams; | 20 struct DownloadParams; |
20 | 21 |
21 // The interface that includes all the operations to interact with low level | 22 // The interface that includes all the operations to interact with low level |
(...skipping 28 matching lines...) Expand all Loading... |
50 | 51 |
51 // Initialize the driver to receive download updates. | 52 // Initialize the driver to receive download updates. |
52 virtual void Initialize(Client* client) = 0; | 53 virtual void Initialize(Client* client) = 0; |
53 | 54 |
54 // Returns if the driver is ready. Returns false when the driver is not | 55 // Returns if the driver is ready. Returns false when the driver is not |
55 // initialized by the client, or low level download library has been shut | 56 // initialized by the client, or low level download library has been shut |
56 // down. | 57 // down. |
57 virtual bool IsReady() const = 0; | 58 virtual bool IsReady() const = 0; |
58 | 59 |
59 // Starts a new download. | 60 // Starts a new download. |
60 virtual void Start(const DownloadParams& params) = 0; | 61 virtual void Start( |
| 62 const DownloadParams& params, |
| 63 const net::NetworkTrafficAnnotationTag& traffic_annotation) = 0; |
61 | 64 |
62 // Cancels an existing download, all data associated with this download should | 65 // Cancels an existing download, all data associated with this download should |
63 // be removed. | 66 // be removed. |
64 virtual void Cancel(const std::string& guid) = 0; | 67 virtual void Cancel(const std::string& guid) = 0; |
65 | 68 |
66 // Pauses the download. | 69 // Pauses the download. |
67 virtual void Pause(const std::string& guid) = 0; | 70 virtual void Pause(const std::string& guid) = 0; |
68 | 71 |
69 // Resumes the download | 72 // Resumes the download |
70 virtual void Resume(const std::string& guid) = 0; | 73 virtual void Resume(const std::string& guid) = 0; |
71 | 74 |
72 // Find a download record from low level download library. | 75 // Find a download record from low level download library. |
73 virtual base::Optional<DriverEntry> Find(const std::string& guid) = 0; | 76 virtual base::Optional<DriverEntry> Find(const std::string& guid) = 0; |
74 }; | 77 }; |
75 | 78 |
76 } // namespace download | 79 } // namespace download |
77 | 80 |
78 #endif // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_ | 81 #endif // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_ |
OLD | NEW |