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

Unified Diff: content/browser/background_fetch/batch_request.h

Issue 2708943002: Create the BackgroundFetchBatchManager and initiate a download. (Closed)
Patch Set: Integrated code review comments and added BackgroundFetchDataManager::BatchData which feeds FetchRe… Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/background_fetch/batch_request.h
diff --git a/content/browser/background_fetch/batch_request.h b/content/browser/background_fetch/batch_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..8ddc44df81acef2c8b8d33ec5d95e4d3dd675d50
--- /dev/null
+++ b/content/browser/background_fetch/batch_request.h
@@ -0,0 +1,50 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_BATCH_REQUEST_H
+#define CONTENT_BROWSER_BACKGROUND_FETCH_BATCH_REQUEST_H
+
+#include <string>
+#include <vector>
+
+#include "content/common/content_export.h"
+#include "content/common/service_worker/service_worker_types.h"
+#include "url/origin.h"
+
+namespace content {
+
+// Class to encapsulate a batch of FetchRequests into a single grouping which is
+// what the developer requested.
+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
+ public:
+ BatchRequest();
+ BatchRequest(const std::string& tag,
+ const url::Origin& origin,
+ int64_t service_worker_registration_id);
+ ~BatchRequest();
+
+ const std::string& guid() const { return guid_; }
+ const std::string& tag() const { return tag_; }
+ const url::Origin& origin() const { return origin_; }
+ int64_t service_worker_registration_id() const {
+ return service_worker_registration_id_;
+ }
+
+ const std::vector<std::string>& fetch_guids() const { return fetch_guids_; }
+
+ private:
+ std::string guid_;
+ std::string tag_;
+ url::Origin origin_;
+ int64_t service_worker_registration_id_ = kInvalidServiceWorkerRegistrationId;
+ std::vector<std::string> fetch_guids_;
+
+ // TODO(harkness): Other things this class should track: estimated download
+ // size, current download size, total number of files, number of complete
+ // files, (possibly) data to show the notification, (possibly) list of in
+ // progress FetchRequests.
+};
+
+} // namespace content
+#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.

Powered by Google App Engine
This is Rietveld 408576698