Chromium Code Reviews| 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 55773de7211e66e8bc174fcde5c538af05a9c6ac..d78222d9ac41c42e872bb3dcfdc143cc1c1a0e5f 100644 |
| --- a/content/browser/background_fetch/background_fetch_context.cc |
| +++ b/content/browser/background_fetch/background_fetch_context.cc |
| @@ -68,8 +68,22 @@ void BackgroundFetchContext::CreateRequest( |
| // 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)); |
| + std::move(job_data), |
| + base::Bind(&BackgroundFetchContext::JobComplete, this, |
| + job_info.guid())); |
|
Peter Beverloo
2017/03/15 16:53:38
We need to clear job_map_ in ShutdownOnIO. This cr
harkness
2017/03/16 11:41:09
Done.
|
| } |
| } |
| +void BackgroundFetchContext::JobComplete(const std::string& job_guid) { |
| + DCHECK(job_map_.find(job_guid) != job_map_.end()); |
| + |
| + // TODO(harkness): Get enough data to send the response back to the |
| + // caller. |
|
Peter Beverloo
2017/03/15 16:53:38
micro nit: same re: the TODO
harkness
2017/03/16 11:41:09
Done.
|
| + |
| + job_map_.erase(job_guid); |
| + |
| + // TODO(harkness): Once the caller receives the message, inform the |
| + // DataManager that it can clean up the pending job. |
| +} |
| + |
| } // namespace content |