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

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

Issue 2854973003: Fix the Unthrottled download count for parallel download (Closed)
Patch Set: Created 3 years, 7 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 | « content/browser/download/download_worker.cc ('k') | content/browser/download/url_downloader.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_URL_DOWNLOADER_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_URL_DOWNLOADER_H_
6 #define CONTENT_BROWSER_DOWNLOAD_URL_DOWNLOADER_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_URL_DOWNLOADER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 22 matching lines...) Expand all
33 virtual void OnUrlDownloaderStarted( 33 virtual void OnUrlDownloaderStarted(
34 std::unique_ptr<DownloadCreateInfo> download_create_info, 34 std::unique_ptr<DownloadCreateInfo> download_create_info,
35 std::unique_ptr<ByteStreamReader> stream_reader, 35 std::unique_ptr<ByteStreamReader> stream_reader,
36 const DownloadUrlParameters::OnStartedCallback& callback) = 0; 36 const DownloadUrlParameters::OnStartedCallback& callback) = 0;
37 37
38 // Called after the connection is cannceled or finished. 38 // Called after the connection is cannceled or finished.
39 virtual void OnUrlDownloaderStopped(UrlDownloader* downloader) = 0; 39 virtual void OnUrlDownloaderStopped(UrlDownloader* downloader) = 0;
40 }; 40 };
41 41
42 UrlDownloader(std::unique_ptr<net::URLRequest> request, 42 UrlDownloader(std::unique_ptr<net::URLRequest> request,
43 base::WeakPtr<Delegate> delegate); 43 base::WeakPtr<Delegate> delegate,
44 bool is_parallel_request);
44 ~UrlDownloader() override; 45 ~UrlDownloader() override;
45 46
46 static std::unique_ptr<UrlDownloader> BeginDownload( 47 static std::unique_ptr<UrlDownloader> BeginDownload(
47 base::WeakPtr<UrlDownloader::Delegate> delegate, 48 base::WeakPtr<UrlDownloader::Delegate> delegate,
48 std::unique_ptr<net::URLRequest> request, 49 std::unique_ptr<net::URLRequest> request,
49 const Referrer& referrer); 50 const Referrer& referrer,
51 bool is_parallel_request);
50 52
51 private: 53 private:
52 class RequestHandle; 54 class RequestHandle;
53 55
54 void Start(); 56 void Start();
55 57
56 // URLRequest::Delegate: 58 // URLRequest::Delegate:
57 void OnReceivedRedirect(net::URLRequest* request, 59 void OnReceivedRedirect(net::URLRequest* request,
58 const net::RedirectInfo& redirect_info, 60 const net::RedirectInfo& redirect_info,
59 bool* defer_redirect) override; 61 bool* defer_redirect) override;
(...skipping 24 matching lines...) Expand all
84 // Live on UI thread, post task to call |delegate_| functions. 86 // Live on UI thread, post task to call |delegate_| functions.
85 base::WeakPtr<Delegate> delegate_; 87 base::WeakPtr<Delegate> delegate_;
86 DownloadRequestCore core_; 88 DownloadRequestCore core_;
87 89
88 base::WeakPtrFactory<UrlDownloader> weak_ptr_factory_; 90 base::WeakPtrFactory<UrlDownloader> weak_ptr_factory_;
89 }; 91 };
90 92
91 } // namespace content 93 } // namespace content
92 94
93 #endif // CONTENT_BROWSER_DOWNLOAD_URL_DOWNLOADER_H_ 95 #endif // CONTENT_BROWSER_DOWNLOAD_URL_DOWNLOADER_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_worker.cc ('k') | content/browser/download/url_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698