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

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

Issue 2689373003: Introduce ParallelDownloadJob. (Closed)
Patch Set: Make windows compiler happy. 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_url_job.h"
6
7 #include "content/public/browser/web_contents.h"
8
9 namespace content {
10
11 DownloadUrlJob::DownloadUrlJob(
12 std::unique_ptr<DownloadRequestHandleInterface> request_handle)
13 : request_handle_(std::move(request_handle)) {}
14
15 DownloadUrlJob::~DownloadUrlJob() = default;
16
17 void DownloadUrlJob::Start() {
18 InitializeDownloadFile();
19 }
20
21 void DownloadUrlJob::Cancel(bool user_cancel) {
22 if (request_handle_)
23 request_handle_->CancelRequest();
24 }
25
26 void DownloadUrlJob::Pause() {
27 if (request_handle_)
28 request_handle_->PauseRequest();
29 }
30
31 void DownloadUrlJob::Resume() {
32 if (request_handle_)
33 request_handle_->ResumeRequest();
34 }
35
36 WebContents* DownloadUrlJob::GetWebContents() const {
37 return request_handle_ ? request_handle_->GetWebContents() : nullptr;
38 }
39
40 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698