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

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

Issue 2782553007: Implement the new polling system in the BackgroundFetchJobController (Closed)
Patch Set: Implement the new polling system in the BFJobController 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 90972e5578c109db4b8f3cd215cdabaa2af44649..6d3e8f5cecf4239e42e2fed9dbbba2f0a46fd8ec 100644
--- a/content/browser/background_fetch/background_fetch_context.cc
+++ b/content/browser/background_fetch/background_fetch_context.cc
@@ -59,14 +59,15 @@ void BackgroundFetchContext::DidCreateRegistration(
const BackgroundFetchRegistrationId& registration_id,
const BackgroundFetchOptions& options,
const blink::mojom::BackgroundFetchService::FetchCallback& callback,
- blink::mojom::BackgroundFetchError error) {
+ blink::mojom::BackgroundFetchError error,
+ std::vector<BackgroundFetchRequestInfo> initial_requests) {
if (error != blink::mojom::BackgroundFetchError::NONE) {
callback.Run(error, base::nullopt /* registration */);
return;
}
// Create the BackgroundFetchJobController, which will do the actual fetching.
- CreateController(registration_id, options);
+ CreateController(registration_id, options, std::move(initial_requests));
// Create the BackgroundFetchRegistration the renderer process will receive,
// which enables it to resolve the promise telling the developer it worked.
@@ -118,13 +119,16 @@ BackgroundFetchJobController* BackgroundFetchContext::GetActiveFetch(
void BackgroundFetchContext::CreateController(
const BackgroundFetchRegistrationId& registration_id,
- const BackgroundFetchOptions& options) {
+ const BackgroundFetchOptions& options,
+ std::vector<BackgroundFetchRequestInfo> initial_requests) {
std::unique_ptr<BackgroundFetchJobController> controller =
base::MakeUnique<BackgroundFetchJobController>(
registration_id, options, browser_context_, storage_partition_,
background_fetch_data_manager_.get(),
base::BindOnce(&BackgroundFetchContext::DidCompleteJob, this));
+ // TODO(peter): Start actually fetching the files.
+
active_fetches_.insert(
std::make_pair(registration_id, std::move(controller)));
}

Powered by Google App Engine
This is Rietveld 408576698