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

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: Why aren't there tests for sniffed MIME types? 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
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..ed183ec7055af66f3029c18fb3ff1f5289084459 100644
--- a/content/browser/download/url_downloader.h
+++ b/content/browser/download/url_downloader.h
@@ -15,23 +15,26 @@
#include "net/url_request/url_request.h"
namespace content {
+class ByteStreamReader;
+struct DownloadCreateInfo;
svaldez 2015/12/17 16:53:32 Are these still needed?
asanka 2015/12/21 20:14:02 Nope. Only DownloadManagerImpl is needed. Thanks!
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 +52,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_;
};

Powered by Google App Engine
This is Rietveld 408576698