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

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

Issue 2752603002: Propagate server response error and interrupt the download. (Closed)
Patch Set: Merge recent changes in the tree. 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
« no previous file with comments | « no previous file | content/browser/download/download_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/byte_stream.h" 10 #include "content/browser/byte_stream.h"
(...skipping 24 matching lines...) Expand all
35 35
36 // Return the WebContents associated with the download. Usually used to 36 // Return the WebContents associated with the download. Usually used to
37 // associate a browser window for any UI that needs to be displayed to the 37 // associate a browser window for any UI that needs to be displayed to the
38 // user. 38 // user.
39 // Or return nullptr if the download is not associated with an active 39 // Or return nullptr if the download is not associated with an active
40 // WebContents. 40 // WebContents.
41 virtual WebContents* GetWebContents() const = 0; 41 virtual WebContents* GetWebContents() const = 0;
42 42
43 protected: 43 protected:
44 void StartDownload() const; 44 void StartDownload() const;
45 void Interrupt(DownloadInterruptReason reason);
45 46
46 // Add a byte stream to the download sink. 47 // Add a byte stream to the download sink.
47 void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader, 48 void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader,
48 int64_t offset, 49 int64_t offset,
49 int64_t length); 50 int64_t length);
50 51
51 DownloadItemImpl* download_item_; 52 DownloadItemImpl* download_item_;
52 53
53 private: 54 private:
54 // If the download progress is paused by the user. 55 // If the download progress is paused by the user.
55 bool is_paused_; 56 bool is_paused_;
56 57
57 DISALLOW_COPY_AND_ASSIGN(DownloadJob); 58 DISALLOW_COPY_AND_ASSIGN(DownloadJob);
58 }; 59 };
59 60
60 } // namespace content 61 } // namespace content
61 62
62 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_H_ 63 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698