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

Unified Diff: content/browser/download/url_downloader.h

Issue 1533583002: [Downloads] Factor out request handling logic between DRH and UD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and change .Pass() -> std::move(...) per PRESUBMIT check Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/download_resource_handler.cc ('k') | content/browser/download/url_downloader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/url_downloader.h
diff --git a/content/browser/download/url_downloader.h b/content/browser/download/url_downloader.h
index c9850920bd433927d34a4cab1999fcb89a64669d..d9bc773ec8361de2f34ec422daf9e07013d9885e 100644
--- a/content/browser/download/url_downloader.h
+++ b/content/browser/download/url_downloader.h
@@ -16,22 +16,22 @@
namespace content {
class DownloadManagerImpl;
-class DownloadRequestCore;
class UrlDownloader : public net::URLRequest::Delegate {
public:
- UrlDownloader(scoped_ptr<net::URLRequest> request,
- scoped_ptr<DownloadRequestCore> handler,
- base::WeakPtr<DownloadManagerImpl> manager);
+ UrlDownloader(
+ scoped_ptr<net::URLRequest> request,
+ base::WeakPtr<DownloadManagerImpl> manager,
+ scoped_ptr<DownloadSaveInfo> save_info,
+ uint32 download_id,
+ const DownloadUrlParameters::OnStartedCallback& on_started_callback);
~UrlDownloader() override;
static scoped_ptr<UrlDownloader> BeginDownload(
base::WeakPtr<DownloadManagerImpl> download_manager,
scoped_ptr<net::URLRequest> request,
const Referrer& referrer,
- bool is_content_initiated,
bool prefer_cache,
- bool do_not_prompt_for_login,
scoped_ptr<DownloadSaveInfo> save_info,
uint32 download_id,
const DownloadUrlParameters::OnStartedCallback& started_callback);
@@ -49,10 +49,21 @@ class UrlDownloader : public net::URLRequest::Delegate {
void Start();
void ResumeReading();
+ void CallStartedCallbackOnFailure(DownloadInterruptReason result);
+
private:
+ class RequestHandle;
+
+ void PauseRequest();
+ void ResumeRequest();
+ void CancelRequest();
+
scoped_ptr<net::URLRequest> request_;
- scoped_ptr<DownloadRequestCore> handler_;
base::WeakPtr<DownloadManagerImpl> manager_;
+ uint32 download_id_;
+ DownloadUrlParameters::OnStartedCallback on_started_callback_;
+
+ DownloadRequestCore handler_;
base::WeakPtrFactory<UrlDownloader> weak_ptr_factory_;
};
« no previous file with comments | « content/browser/download/download_resource_handler.cc ('k') | content/browser/download/url_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698