Chromium Code Reviews| 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_; |
| }; |