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 26 matching lines...) Expand all Loading... |
48 | 49 |
49 // Initialize the driver to receive download updates. | 50 // Initialize the driver to receive download updates. |
50 virtual void Initialize(Client* client) = 0; | 51 virtual void Initialize(Client* client) = 0; |
51 | 52 |
52 // Returns if the driver is ready. Returns false when the driver is not | 53 // Returns if the driver is ready. Returns false when the driver is not |
53 // initialized by the client, or low level download library has been shut | 54 // initialized by the client, or low level download library has been shut |
54 // down. | 55 // down. |
55 virtual bool IsReady() const = 0; | 56 virtual bool IsReady() const = 0; |
56 | 57 |
57 // Starts a new download. | 58 // Starts a new download. |
58 virtual void Start(const DownloadParams& params) = 0; | 59 virtual void Start( |
| 60 const DownloadParams& params, |
| 61 const net::NetworkTrafficAnnotationTag& traffic_annotation) = 0; |
59 | 62 |
60 // Cancels an existing download, all data associated with this download should | 63 // Cancels an existing download, all data associated with this download should |
61 // be removed. | 64 // be removed. |
62 virtual void Cancel(const std::string& guid) = 0; | 65 virtual void Cancel(const std::string& guid) = 0; |
63 | 66 |
64 // Pauses the download. | 67 // Pauses the download. |
65 virtual void Pause(const std::string& guid) = 0; | 68 virtual void Pause(const std::string& guid) = 0; |
66 | 69 |
67 // Resumes the download | 70 // Resumes the download |
68 virtual void Resume(const std::string& guid) = 0; | 71 virtual void Resume(const std::string& guid) = 0; |
69 | 72 |
70 // Find a download record from low level download library. | 73 // Find a download record from low level download library. |
71 virtual base::Optional<DriverEntry> Find(const std::string& guid) = 0; | 74 virtual base::Optional<DriverEntry> Find(const std::string& guid) = 0; |
72 }; | 75 }; |
73 | 76 |
74 } // namespace download | 77 } // namespace download |
75 | 78 |
76 #endif // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_ | 79 #endif // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_ |
OLD | NEW |