OLD | NEW |
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 #include "content/browser/background_fetch/background_fetch_job_controller.h" | 5 #include "content/browser/background_fetch/background_fetch_job_controller.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 item->RemoveObserver(this); | 121 item->RemoveObserver(this); |
122 } | 122 } |
123 | 123 |
124 void BackgroundFetchJobController::ProcessRequest( | 124 void BackgroundFetchJobController::ProcessRequest( |
125 const BackgroundFetchRequestInfo& fetch_request) { | 125 const BackgroundFetchRequestInfo& fetch_request) { |
126 // TODO(harkness): Check if the download is already in progress or completed. | 126 // TODO(harkness): Check if the download is already in progress or completed. |
127 | 127 |
128 // Set up the download parameters and the OnStartedCallback. | 128 // Set up the download parameters and the OnStartedCallback. |
129 std::unique_ptr<DownloadUrlParameters> params( | 129 std::unique_ptr<DownloadUrlParameters> params( |
130 base::MakeUnique<DownloadUrlParameters>( | 130 base::MakeUnique<DownloadUrlParameters>( |
131 fetch_request.url(), storage_partition_->GetURLRequestContext())); | 131 fetch_request.GetUrl(), storage_partition_->GetURLRequestContext())); |
132 params->set_callback( | 132 params->set_callback( |
133 base::Bind(&BackgroundFetchJobController::DownloadStarted, | 133 base::Bind(&BackgroundFetchJobController::DownloadStarted, |
134 weak_ptr_factory_.GetWeakPtr(), fetch_request.guid())); | 134 weak_ptr_factory_.GetWeakPtr(), fetch_request.guid())); |
135 | 135 |
136 BrowserContext::GetDownloadManager(browser_context_) | 136 BrowserContext::GetDownloadManager(browser_context_) |
137 ->DownloadUrl(std::move(params)); | 137 ->DownloadUrl(std::move(params)); |
138 } | 138 } |
139 | 139 |
140 } // namespace content | 140 } // namespace content |
OLD | NEW |