Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_BATCH_REQUEST_H | |
| 6 #define CONTENT_BROWSER_BACKGROUND_FETCH_BATCH_REQUEST_H | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "content/common/content_export.h" | |
| 12 #include "content/common/service_worker/service_worker_types.h" | |
| 13 #include "url/origin.h" | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 // Class to encapsulate a batch of FetchRequests into a single grouping which is | |
| 18 // what the developer requested. | |
| 19 class CONTENT_EXPORT BatchRequest { | |
|
Peter Beverloo
2017/02/24 02:05:16
Please make this non-copyable.
Peter Beverloo
2017/02/24 02:05:16
Can we call this BackgroundFetchBatchRequest? (dit
harkness
2017/02/24 11:47:11
Done.
harkness
2017/02/24 11:47:11
Sure, I can do that, but as a follow-up to this wh
Peter Beverloo
2017/02/24 15:43:14
Please send a CL that *only* does the rename. That
| |
| 20 public: | |
| 21 BatchRequest(); | |
| 22 BatchRequest(const std::string& tag, | |
| 23 const url::Origin& origin, | |
| 24 int64_t service_worker_registration_id); | |
| 25 ~BatchRequest(); | |
| 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>& fetch_guids() const { return fetch_guids_; } | |
| 35 | |
| 36 private: | |
| 37 std::string guid_; | |
| 38 std::string tag_; | |
| 39 url::Origin origin_; | |
| 40 int64_t service_worker_registration_id_ = kInvalidServiceWorkerRegistrationId; | |
| 41 std::vector<std::string> fetch_guids_; | |
| 42 | |
| 43 // TODO(harkness): Other things this class should track: estimated download | |
| 44 // size, current download size, total number of files, number of complete | |
| 45 // files, (possibly) data to show the notification, (possibly) list of in | |
| 46 // progress FetchRequests. | |
| 47 }; | |
| 48 | |
| 49 } // namespace content | |
| 50 #endif // CONTENT_BROWSER_BACKGROUND_FETCH_BATCH_REQUEST_H | |
|
Peter Beverloo
2017/02/24 02:05:16
blank line
harkness
2017/02/24 11:47:11
Done.
| |
| OLD | NEW |