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

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

Issue 2727253002: Added DownloadItem::Observer to JobController. (Closed)
Patch Set: Cleanup Created 3 years, 10 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 ce0b6e5e385b3a6d3aaf4a1820b38ceb91e5ff4c..339cba7e80abd6e9e457dcd36e935a29b647a450 100644
--- a/content/browser/background_fetch/background_fetch_context.cc
+++ b/content/browser/background_fetch/background_fetch_context.cc
@@ -34,8 +34,6 @@ BackgroundFetchContext::~BackgroundFetchContext() {
void BackgroundFetchContext::Init() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
- // TODO(harkness): Create the Download observer.
}
void BackgroundFetchContext::Shutdown() {
@@ -55,6 +53,17 @@ void BackgroundFetchContext::ShutdownOnIO() {
job.second->Shutdown();
}
+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.
+
+ job_map_.erase(job_guid);
+
+ // TODO(harkness): Once the caller receives the message, inform the
+ // DataManager that it can clean up the pending job.
+}
+
void BackgroundFetchContext::CreateRequest(
const BackgroundFetchJobInfo& job_info,
std::vector<BackgroundFetchRequestInfo>& request_infos) {

Powered by Google App Engine
This is Rietveld 408576698