Chromium Code Reviews| 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/core/background/save_page_request.h" | 5 #include "components/offline_pages/core/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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 void SavePageRequest::MarkAttemptCompleted() { | 75 void SavePageRequest::MarkAttemptCompleted() { |
| 76 ++completed_attempt_count_; | 76 ++completed_attempt_count_; |
| 77 state_ = RequestState::AVAILABLE; | 77 state_ = RequestState::AVAILABLE; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void SavePageRequest::MarkAttemptAborted() { | 80 void SavePageRequest::MarkAttemptAborted() { |
| 81 DCHECK_GT(started_attempt_count_, 0); | 81 DCHECK_GT(started_attempt_count_, 0); |
| 82 // We intentinally do not increment the completed_attempt_count_, since this | 82 // We intentinally do not increment the completed_attempt_count_, since this |
| 83 // was killed before it completed, so we could use the phone or browser for | 83 // was killed before it completed, so we could use the phone or browser for |
| 84 // other things. | 84 // other things. |
| 85 state_ = RequestState::AVAILABLE; | 85 if (state_ == RequestState::OFFLINING) |
|
dougarnett
2016/12/21 19:25:21
Please update the method comment in .h to be accur
Pete Williamson
2016/12/21 19:30:55
Done.
| |
| 86 state_ = RequestState::AVAILABLE; | |
| 86 } | 87 } |
| 87 | 88 |
| 88 void SavePageRequest::MarkAttemptPaused() { | 89 void SavePageRequest::MarkAttemptPaused() { |
| 89 state_ = RequestState::PAUSED; | 90 state_ = RequestState::PAUSED; |
| 90 } | 91 } |
| 91 | 92 |
| 92 } // namespace offline_pages | 93 } // namespace offline_pages |
| OLD | NEW |