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