| OLD | NEW |
| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void SavePageRequest::MarkAttemptCompleted() { | 76 void SavePageRequest::MarkAttemptCompleted() { |
| 77 ++completed_attempt_count_; | 77 ++completed_attempt_count_; |
| 78 state_ = RequestState::AVAILABLE; | 78 state_ = RequestState::AVAILABLE; |
| 79 } | 79 } |
| 80 | 80 |
| 81 void SavePageRequest::MarkAttemptAborted() { | 81 void SavePageRequest::MarkAttemptAborted() { |
| 82 DCHECK_GT(started_attempt_count_, 0); | 82 DCHECK_GT(started_attempt_count_, 0); |
| 83 // We intentinally do not increment the completed_attempt_count_, since this | 83 // We intentinally do not increment the completed_attempt_count_, since this |
| 84 // was killed before it completed, so we could use the phone or browser for | 84 // was killed before it completed, so we could use the phone or browser for |
| 85 // other things. | 85 // other things. |
| 86 state_ = RequestState::AVAILABLE; | 86 if (state_ == RequestState::OFFLINING) |
| 87 state_ = RequestState::AVAILABLE; |
| 87 } | 88 } |
| 88 | 89 |
| 89 void SavePageRequest::MarkAttemptPaused() { | 90 void SavePageRequest::MarkAttemptPaused() { |
| 90 state_ = RequestState::PAUSED; | 91 state_ = RequestState::PAUSED; |
| 91 } | 92 } |
| 92 | 93 |
| 93 } // namespace offline_pages | 94 } // namespace offline_pages |
| OLD | NEW |