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

Unified Diff: content/browser/background_fetch/background_fetch_context.cc

Issue 2763613004: Use std::unique_ptr for access to BackgroundFetchJobInfo (Closed)
Patch Set: Missed one 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/background_fetch/background_fetch_context.cc
diff --git a/content/browser/background_fetch/background_fetch_context.cc b/content/browser/background_fetch/background_fetch_context.cc
index a6dfc65bf78c7db17c1be21ad27782dfc729e133..21f3dcd0d3790a440166a6284f8c338c0cd3092e 100644
--- a/content/browser/background_fetch/background_fetch_context.cc
+++ b/content/browser/background_fetch/background_fetch_context.cc
@@ -55,24 +55,25 @@ void BackgroundFetchContext::ShutdownOnIO() {
}
void BackgroundFetchContext::CreateRequest(
- const BackgroundFetchJobInfo& job_info,
+ std::unique_ptr<BackgroundFetchJobInfo> job_info,
std::vector<BackgroundFetchRequestInfo>& request_infos) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK_GE(1U, request_infos.size());
// Inform the data manager about the new download.
+ const std::string job_guid = job_info->guid();
std::unique_ptr<BackgroundFetchJobData> job_data =
- background_fetch_data_manager_.CreateRequest(job_info, request_infos);
+ background_fetch_data_manager_.CreateRequest(std::move(job_info),
+ request_infos);
// If job_data is null, the DataManager will have logged an error.
if (job_data) {
// Create a controller which drives the processing of the job. It will use
// the JobData to get information about individual requests for the job.
- job_map_[job_info.guid()] = base::MakeUnique<BackgroundFetchJobController>(
- job_info.guid(), browser_context_, storage_partition_,
- std::move(job_data),
+ job_map_[job_guid] = base::MakeUnique<BackgroundFetchJobController>(
+ job_guid, browser_context_, storage_partition_, std::move(job_data),
base::BindOnce(&BackgroundFetchContext::DidCompleteJob, this,
- job_info.guid()));
+ job_guid));
}
}

Powered by Google App Engine
This is Rietveld 408576698