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

Side by Side Diff: components/offline_pages/core/background/save_page_request.cc

Issue 2598573003: Fix for crbug.com/675863 - don't clobber PAUSE state. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698