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

Side by Side 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: Fix trybot complaint for no return value on string mapping methods 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/offline_pages/background/save_page_request.h" 5 #include "components/offline_pages/background/save_page_request.h"
6 6
7 namespace offline_pages { 7 namespace offline_pages {
8 8
9 SavePageRequest::SavePageRequest(int64_t request_id, 9 SavePageRequest::SavePageRequest(int64_t request_id,
10 const GURL& url, 10 const GURL& url,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // check here to ensure we only start tasks in status pending, and bail out in 71 // check here to ensure we only start tasks in status pending, and bail out in
72 // other cases. 72 // other cases.
73 last_attempt_time_ = start_time; 73 last_attempt_time_ = start_time;
74 ++attempt_count_; 74 ++attempt_count_;
75 } 75 }
76 76
77 void SavePageRequest::MarkAttemptCompleted() { 77 void SavePageRequest::MarkAttemptCompleted() {
78 last_attempt_time_ = base::Time(); 78 last_attempt_time_ = base::Time();
79 } 79 }
80 80
81 void SavePageRequest::MarkAttemptAborted() {
82 DCHECK_GT(attempt_count_, 0);
83 last_attempt_time_ = base::Time();
84 // TODO(dougarnett): Would be safer if we had two persisted counters
85 // (attempts_started and attempts_completed) rather just one with decrement.
86 --attempt_count_;
fgorski 2016/08/04 06:01:34 based on discussion we had today with pete, dimich
dougarnett 2016/08/04 16:24:38 So change MarkAttemptStarted and MarkAttemptComple
dougarnett 2016/08/04 16:45:28 Pondering a bit more, I think we should keep this
87 }
88
81 } // namespace offline_pages 89 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698