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

Unified Diff: components/offline_pages/core/background/offliner_stub.cc

Issue 2637563002: [Offline Pages] Snapshotting on timeout of last retry. (Closed)
Patch Set: merging with master again 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: components/offline_pages/core/background/offliner_stub.cc
diff --git a/components/offline_pages/core/background/offliner_stub.cc b/components/offline_pages/core/background/offliner_stub.cc
index 0455fe08d7155575ba2d3d8eb96aa38c41658371..3b3c1f56164da0ca94ff8a3f7633e756edf5b49b 100644
--- a/components/offline_pages/core/background/offliner_stub.cc
+++ b/components/offline_pages/core/background/offliner_stub.cc
@@ -11,7 +11,10 @@
namespace offline_pages {
OfflinerStub::OfflinerStub()
- : disable_loading_(false), enable_callback_(false), cancel_called_(false) {}
+ : disable_loading_(false),
+ enable_callback_(false),
+ cancel_called_(false),
+ snapshot_on_last_retry_(false) {}
OfflinerStub::~OfflinerStub() {}
@@ -35,4 +38,14 @@ void OfflinerStub::Cancel() {
cancel_called_ = true;
}
+bool OfflinerStub::HandleTimeout(const SavePageRequest& request) {
+ if (snapshot_on_last_retry_) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::Bind(callback_, request, Offliner::RequestStatus::SAVED));
+ return true;
+ }
+ return false;
+}
+
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698