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

Side by Side Diff: content/browser/background_fetch/background_fetch_job_controller.cc

Issue 2778793002: Start aligning BackgroundFetchRequestInfo with the passed in request object. (Closed)
Patch Set: Created 3 years, 9 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698