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

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

Issue 2895953004: Add initial Controller to DownloadService (Closed)
Patch Set: Rebased 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
« no previous file with comments | « components/download/internal/config.cc ('k') | components/download/internal/controller_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_H_
6 #define COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "components/download/public/clients.h"
12
13 namespace download {
14
15 struct DownloadParams;
16 struct SchedulingParams;
17 struct StartupStatus;
18
19 // The core Controller responsible for gluing various DownloadService components
20 // together to manage the active downloads.
21 class Controller {
22 public:
23 Controller() = default;
24 virtual ~Controller() = default;
25
26 // Initializes the controller. Initialization may be asynchronous.
27 virtual void Initialize() = 0;
28
29 // Returns the status of Controller.
30 virtual const StartupStatus& GetStartupStatus() = 0;
31
32 // Starts a download with |params|. See DownloadParams::StartCallback and
33 // DownloadParams::StartResponse for information on how a caller can determine
34 // whether or not the download was successfully accepted and queued.
35 virtual void StartDownload(const DownloadParams& params) = 0;
36
37 // Pauses a download request associated with |guid| if one exists.
38 virtual void PauseDownload(const std::string& guid) = 0;
39
40 // Resumes a download request associated with |guid| if one exists. The
41 // download request may or may not start downloading at this time, but it will
42 // no longer be blocked by any prior PauseDownload() actions.
43 virtual void ResumeDownload(const std::string& guid) = 0;
44
45 // Cancels a download request associated with |guid| if one exists.
46 virtual void CancelDownload(const std::string& guid) = 0;
47
48 // Changes the SchedulingParams of a download request associated with |guid|
49 // to |params|.
50 virtual void ChangeDownloadCriteria(const std::string& guid,
51 const SchedulingParams& params) = 0;
52
53 // Exposes the owner of the download request for |guid| if one exists.
54 // Otherwise returns DownloadClient::INVALID for an unowned entry.
55 virtual DownloadClient GetOwnerOfDownload(const std::string& guid) = 0;
56
57 private:
58 DISALLOW_COPY_AND_ASSIGN(Controller);
59 };
60
61 } // namespace download
62
63 #endif // COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_H_
OLDNEW
« no previous file with comments | « components/download/internal/config.cc ('k') | components/download/internal/controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698