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

Side by Side Diff: content/browser/background_fetch/background_fetch_job_info.h

Issue 2708943002: Create the BackgroundFetchBatchManager and initiate a download. (Closed)
Patch Set: fixed nits Created 3 years, 9 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
(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 CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_INFO_H
6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_INFO_H
7
8 #include <string>
9 #include <vector>
10
11 #include "base/macros.h"
12 #include "content/common/content_export.h"
13 #include "content/common/service_worker/service_worker_types.h"
14 #include "url/origin.h"
15
16 namespace content {
17
18 // Class to encapsulate a batch of FetchRequests into a single grouping which is
19 // what the developer requested.
20 class CONTENT_EXPORT BackgroundFetchJobInfo {
21 public:
22 BackgroundFetchJobInfo(const std::string& tag,
23 const url::Origin& origin,
24 int64_t service_worker_registration_id);
25 ~BackgroundFetchJobInfo();
26
27 const std::string& guid() const { return guid_; }
28 const std::string& tag() const { return tag_; }
29 const url::Origin& origin() const { return origin_; }
30 int64_t service_worker_registration_id() const {
31 return service_worker_registration_id_;
32 }
33
34 const std::vector<std::string>& request_guids() const {
35 return request_guids_;
36 }
37
38 private:
39 std::string guid_;
40 std::string tag_;
41 url::Origin origin_;
42 int64_t service_worker_registration_id_ = kInvalidServiceWorkerRegistrationId;
43 std::vector<std::string> request_guids_;
44
45 // TODO(harkness): Other things this class should track: estimated download
46 // size, current download size, total number of files, number of complete
47 // files, (possibly) data to show the notification, (possibly) list of in
48 // progress FetchRequests.
49
50 DISALLOW_COPY_AND_ASSIGN(BackgroundFetchJobInfo);
51 };
52
53 } // namespace content
54
55 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_INFO_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698