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

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

Issue 2689373003: Introduce ParallelDownloadJob. (Closed)
Patch Set: Polish some details. Created 3 years, 10 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <content/browser/download/download_job_impl.h>
6 #include "content/public/browser/web_contents.h"
7
8 namespace content {
9
10 DownloadJobImpl::DownloadJobImpl(
11 DownloadItemImpl* download_item,
12 std::unique_ptr<DownloadRequestHandleInterface> request_handle)
13 : DownloadJob(download_item), request_handle_(std::move(request_handle)) {}
14
15 DownloadJobImpl::~DownloadJobImpl() = default;
16
17 void DownloadJobImpl::Start() {
18 StartDownloadProgress();
19 }
20
21 void DownloadJobImpl::Cancel(bool user_cancel) {
22 if (request_handle_)
23 request_handle_->CancelRequest();
24 }
25
26 void DownloadJobImpl::Pause() {
27 DownloadJob::Pause();
28 if (request_handle_)
29 request_handle_->PauseRequest();
30 }
31
32 void DownloadJobImpl::Resume() {
33 if (request_handle_)
34 request_handle_->ResumeRequest();
35
36 DownloadJob::Resume();
37 }
38
39 WebContents* DownloadJobImpl::GetWebContents() const {
40 return request_handle_ ? request_handle_->GetWebContents() : nullptr;
41 }
42
43 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698