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

Side by Side Diff: content/browser/download/download_job.cc

Issue 2752603002: Propagate server response error and interrupt the download. (Closed)
Patch Set: Work on feedbacks. Created 3 years, 9 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "content/browser/download/download_job.h" 5 #include "content/browser/download/download_job.h"
6 6
7 #include "content/browser/download/download_item_impl.h" 7 #include "content/browser/download/download_item_impl.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 DownloadJob::DownloadJob(DownloadItemImpl* download_item) 11 DownloadJob::DownloadJob(DownloadItemImpl* download_item)
12 : download_item_(download_item), is_paused_(false) {} 12 : download_item_(download_item), is_paused_(false) {}
13 13
14 DownloadJob::~DownloadJob() = default; 14 DownloadJob::~DownloadJob() = default;
15 15
16 void DownloadJob::Pause() { 16 void DownloadJob::Pause() {
17 is_paused_ = true; 17 is_paused_ = true;
18 } 18 }
19 19
20 void DownloadJob::Resume(bool resume_request) { 20 void DownloadJob::Resume(bool resume_request) {
21 is_paused_ = false; 21 is_paused_ = false;
22 } 22 }
23 23
24 void DownloadJob::StartDownload() const { 24 void DownloadJob::StartDownload() const {
25 download_item_->StartDownload(); 25 download_item_->StartDownload();
26 } 26 }
27 27
28 void DownloadJob::Interrupt(DownloadInterruptReason reason) {
29 download_item_->InterruptAndDiscardPartialState(reason);
qinmin 2017/03/17 05:09:46 This doesn't update the download_item_'s observers
xingliu 2017/03/17 21:14:36 Done, thanks for this suggestion.
30 }
31
28 } // namespace content 32 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698