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

Unified Diff: components/offline_pages/background/save_page_request.h

Issue 1932953002: [Offline pages] Empty RequestQueue and SavePageRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding build files and fixing compilation issues Created 4 years, 8 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: components/offline_pages/background/save_page_request.h
diff --git a/components/offline_pages/background/save_page_request.h b/components/offline_pages/background/save_page_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..4b46ec9386c20e606cd527adfc192cdd0e377a7f
--- /dev/null
+++ b/components/offline_pages/background/save_page_request.h
@@ -0,0 +1,61 @@
+// Copyright 2016 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 COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_
+#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_
+
+#include <stdint.h>
+
+#include "base/time/time.h"
+#include "components/offline_pages/offline_page_item.h"
+#include "url/gurl.h"
+
+namespace offline_pages {
+
+// Class representing a request to save page.
+struct SavePageRequest {
+ public:
+ enum Status {
+ WAITING, // Component requested a page be saved, but not until a
dougarnett 2016/04/29 15:39:14 I'm not sure about this definition of WAITING. Fro
fgorski 2016/04/30 18:56:14 not ready it is
+ // certain time in future.
+ ACTIVE, // Page request is active, and coordinator can attempt it when
dougarnett 2016/04/29 15:39:14 ACTIVE name is misleading name to me for this defi
fgorski 2016/04/30 18:56:14 Done.
+ // it gets a chance to.
+ IN_PROGRESS, // The request is currently being processed.
+ FAILED, // Page request failed many times and will no longer be
+ // retried.
+ EXPIRED, // Save page request expired without being fulfilled.
+ };
+
+ SavePageRequest();
+ ~SavePageRequest();
+
+ // ID of this request.
+ int64_t request_id;
+
+ // Status of this request.
+ Status status;
+
+ // Online URL of a page to be offlined.
+ GURL url;
+
+ // Client ID related to the request. Contains namespace and ID assigned by the
+ // requester.
+ ClientId client_id;
+
+ // Time when this request was created. (Alternative 2).
+ base::Time creation_time;
+
+ // Time when this request will become active.
+ base::Time request_activation_time;
+
+ // Number of attempts made to get the page.
+ int attempt_count;
+
+ // Timestamp of the last request starting.
+ base::Time last_attempt_time;
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SAVE_PAGE_REQUEST_H_

Powered by Google App Engine
This is Rietveld 408576698