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

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

Issue 2599593002: Fix for crbug.com/675863 - don't clobber PAUSE state. (Closed)
Patch Set: Add unit test back in. Created 3 years, 12 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
« no previous file with comments | « components/offline_pages/background/save_page_request.h ('k') | 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/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
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
OLDNEW
« no previous file with comments | « components/offline_pages/background/save_page_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698