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

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

Issue 2901383007: Don't create parallel request until download file is initialized (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_job.cc ('k') | content/browser/download/download_job_impl.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_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/browser/download/download_item_impl.h" 9 #include "content/browser/download/download_item_impl.h"
10 #include "content/browser/download/download_job.h" 10 #include "content/browser/download/download_job.h"
11 #include "content/browser/download/download_request_handle.h" 11 #include "content/browser/download/download_request_handle.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class CONTENT_EXPORT DownloadJobImpl : public DownloadJob { 16 class CONTENT_EXPORT DownloadJobImpl : public DownloadJob {
17 public: 17 public:
18 DownloadJobImpl( 18 DownloadJobImpl(
19 DownloadItemImpl* download_item, 19 DownloadItemImpl* download_item,
20 std::unique_ptr<DownloadRequestHandleInterface> request_handle, 20 std::unique_ptr<DownloadRequestHandleInterface> request_handle,
21 bool is_parallizable); 21 bool is_parallizable);
22 ~DownloadJobImpl() override; 22 ~DownloadJobImpl() override;
23 23
24 // DownloadJob implementation. 24 // DownloadJob implementation.
25 void Start() override;
26 void Cancel(bool user_cancel) override; 25 void Cancel(bool user_cancel) override;
27 void Pause() override; 26 void Pause() override;
28 void Resume(bool resume_request) override; 27 void Resume(bool resume_request) override;
29 WebContents* GetWebContents() const override; 28 WebContents* GetWebContents() const override;
30 bool IsParallelizable() const override; 29 bool IsParallelizable() const override;
31 30
32 private: 31 private:
33 // Used to perform operations on network request. 32 // Used to perform operations on network request.
34 // Can be null on interrupted download. 33 // Can be null on interrupted download.
35 std::unique_ptr<DownloadRequestHandleInterface> request_handle_; 34 std::unique_ptr<DownloadRequestHandleInterface> request_handle_;
36 35
37 // Whether the download can be parallized. 36 // Whether the download can be parallized.
38 bool is_parallizable_; 37 bool is_parallizable_;
39 38
40 DISALLOW_COPY_AND_ASSIGN(DownloadJobImpl); 39 DISALLOW_COPY_AND_ASSIGN(DownloadJobImpl);
41 }; 40 };
42 41
43 } // namespace content 42 } // namespace content
44 43
45 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_ 44 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_job.cc ('k') | content/browser/download/download_job_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698