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

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

Issue 2777183002: Hook up the other Background Fetch Mojo methods with the system (Closed)
Patch Set: Hook up the other Background Fetch Mojo methods with the system 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_job_controller.cc
diff --git a/content/browser/background_fetch/background_fetch_job_controller.cc b/content/browser/background_fetch/background_fetch_job_controller.cc
index 0e045cf0afafb873df690658ad9921b0e3e4fc48..088e04232b0f7e06ac2b96db97c748ead6c4b6a2 100644
--- a/content/browser/background_fetch/background_fetch_job_controller.cc
+++ b/content/browser/background_fetch/background_fetch_job_controller.cc
@@ -20,11 +20,13 @@ namespace content {
BackgroundFetchJobController::BackgroundFetchJobController(
const BackgroundFetchRegistrationId& registration_id,
+ const BackgroundFetchOptions& options,
BrowserContext* browser_context,
StoragePartition* storage_partition,
BackgroundFetchDataManager* data_manager,
CompletedCallback completed_callback)
: registration_id_(registration_id),
+ options_(options),
job_guid_(base::GenerateGUID()),
browser_context_(browser_context),
storage_partition_(storage_partition),
@@ -62,6 +64,17 @@ void BackgroundFetchJobController::StartProcessing() {
// Currently, this processes a single request at a time.
}
+void BackgroundFetchJobController::UpdateUI(const std::string& title) {
+ // TODO(harkness): Update the user interface with |title|.
+}
+
+void BackgroundFetchJobController::Abort() {
+ // TODO(harkness): Abort all in-progress downloads.
+
+ std::move(completed_callback_)
+ .Run(registration_id_, true /* aborted_by_developer */);
+}
+
void BackgroundFetchJobController::DownloadStarted(
const std::string& request_guid,
DownloadItem* item,
@@ -101,7 +114,8 @@ void BackgroundFetchJobController::OnDownloadUpdated(DownloadItem* item) {
ProcessRequest(
data_manager_->GetNextBackgroundFetchRequestInfo(job_guid_));
} else if (data_manager_->IsComplete(job_guid_)) {
- std::move(completed_callback_).Run(registration_id_);
+ std::move(completed_callback_)
+ .Run(registration_id_, false /* aborted_by_developer */);
}
break;
case DownloadItem::DownloadState::INTERRUPTED:

Powered by Google App Engine
This is Rietveld 408576698