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

Unified 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, 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/background_fetch_job_info.h
diff --git a/content/browser/background_fetch/background_fetch_job_info.h b/content/browser/background_fetch/background_fetch_job_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..aba5bd8fa89a22e4590e3e88890c6b2cc35aede1
--- /dev/null
+++ b/content/browser/background_fetch/background_fetch_job_info.h
@@ -0,0 +1,55 @@
+// 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_BACKGROUND_FETCH_JOB_INFO_H
+#define CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_INFO_H
+
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#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 BackgroundFetchJobInfo {
+ public:
+ BackgroundFetchJobInfo(const std::string& tag,
+ const url::Origin& origin,
+ int64_t service_worker_registration_id);
+ ~BackgroundFetchJobInfo();
+
+ 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>& request_guids() const {
+ return request_guids_;
+ }
+
+ private:
+ std::string guid_;
+ std::string tag_;
+ url::Origin origin_;
+ int64_t service_worker_registration_id_ = kInvalidServiceWorkerRegistrationId;
+ std::vector<std::string> request_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.
+
+ DISALLOW_COPY_AND_ASSIGN(BackgroundFetchJobInfo);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_BACKGROUND_FETCH_BACKGROUND_FETCH_JOB_INFO_H

Powered by Google App Engine
This is Rietveld 408576698