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

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

Issue 2796953003: Populate the response blob for finished Background Fetches (Closed)
Patch Set: Populate the response blob for finished Background Fetches Created 3 years, 8 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 d71a9a5674553cd52e9c5c1226e883ff54fa7ff4..11e58e55e29e346b3f6401a6ff88453894faa52f 100644
--- a/content/browser/background_fetch/background_fetch_context.cc
+++ b/content/browser/background_fetch/background_fetch_context.cc
@@ -174,7 +174,8 @@ void BackgroundFetchContext::DidCompleteJob(
// The `backgroundfetched` and/or `backgroundfetchfail` event will only be
// invoked for Background Fetch jobs which have been completed.
if (controller->state() != BackgroundFetchJobController::State::COMPLETED) {
- DeleteRegistration(registration_id);
+ DeleteRegistration(registration_id,
+ std::vector<std::unique_ptr<BlobHandle>>());
return;
}
@@ -191,7 +192,7 @@ void BackgroundFetchContext::DidGetSettledFetches(
std::vector<BackgroundFetchSettledFetch> settled_fetches,
std::vector<std::unique_ptr<BlobHandle>> blob_handles) {
if (error != blink::mojom::BackgroundFetchError::NONE) {
- DeleteRegistration(registration_id);
+ DeleteRegistration(registration_id, std::move(blob_handles));
return;
}
@@ -202,11 +203,12 @@ void BackgroundFetchContext::DidGetSettledFetches(
event_dispatcher_->DispatchBackgroundFetchedEvent(
registration_id, std::move(settled_fetches),
base::Bind(&BackgroundFetchContext::DeleteRegistration, this,
- registration_id));
+ registration_id, std::move(blob_handles)));
}
void BackgroundFetchContext::DeleteRegistration(
- const BackgroundFetchRegistrationId& registration_id) {
+ const BackgroundFetchRegistrationId& registration_id,
+ const std::vector<std::unique_ptr<BlobHandle>>& blob_handles) {
harkness 2017/04/05 09:26:00 Why do you think we're going to need the blob hand
Peter Beverloo 2017/04/05 09:39:27 We don't, but we need to keep the handles alive fo
DCHECK_GT(active_fetches_.count(registration_id), 0u);
// Delete all persistent information associated with the |registration_id|.

Powered by Google App Engine
This is Rietveld 408576698