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

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

Issue 2209813002: [Offline Pages] Moves Coordinator to using MarkAttemptStarted/MarkAttemptCompleted API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 4 years, 4 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.cc
diff --git a/components/offline_pages/background/save_page_request.cc b/components/offline_pages/background/save_page_request.cc
index f9372f340a47373ef44a7cb5940d925d810265e5..e5424d703611034e35a24bc1d32703e5aefb6915 100644
--- a/components/offline_pages/background/save_page_request.cc
+++ b/components/offline_pages/background/save_page_request.cc
@@ -78,4 +78,12 @@ void SavePageRequest::MarkAttemptCompleted() {
last_attempt_time_ = base::Time();
}
+void SavePageRequest::MarkAttemptAborted() {
+ DCHECK_GT(attempt_count_, 0);
+ last_attempt_time_ = base::Time();
+ // TODO(dougarnett): Would be safer if we had two persisted counters
+ // (attempts_started and attempts_completed) rather just one with decrement.
+ --attempt_count_;
+}
+
} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698