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

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

Issue 2860593003: Refactoring DownloadManager::DownloadURL to add proper annotation. (Closed)
Patch Set: Comment addressed. Created 3 years, 6 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
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
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_
OLDNEW
« no previous file with comments | « components/download/content/download_driver_impl.cc ('k') | components/download/internal/test/test_download_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698