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

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

Issue 2786783002: Dispatch a bare Service Worker event for a finished Background Fetch (Closed)
Patch Set: Dispatch a bare Service Worker event for a finished Background Fetch 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
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/background_fetch/background_fetch_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/background_fetch/background_fetch_context.h
diff --git a/content/browser/background_fetch/background_fetch_context.h b/content/browser/background_fetch/background_fetch_context.h
index e0b0fc38ac0816869898150317d08a0ad1953c10..ec41d64dbe977d54975777558ff34fc630a1d3f7 100644
--- a/content/browser/background_fetch/background_fetch_context.h
+++ b/content/browser/background_fetch/background_fetch_context.h
@@ -26,10 +26,12 @@ class Origin;
namespace content {
class BackgroundFetchDataManager;
+class BackgroundFetchEventDispatcher;
class BackgroundFetchJobController;
struct BackgroundFetchOptions;
class BackgroundFetchRegistrationId;
class BackgroundFetchRequestInfo;
+class BlobHandle;
class BrowserContext;
class ServiceWorkerContextWrapper;
struct ServiceWorkerFetchRequest;
@@ -45,10 +47,9 @@ class CONTENT_EXPORT BackgroundFetchContext
public:
// The BackgroundFetchContext will watch the ServiceWorkerContextWrapper so
// that it can respond to service worker events such as unregister.
- BackgroundFetchContext(
- BrowserContext* browser_context,
- StoragePartitionImpl* storage_partition,
- const scoped_refptr<ServiceWorkerContextWrapper>& context);
+ BackgroundFetchContext(BrowserContext* browser_context,
+ StoragePartitionImpl* storage_partition,
+ scoped_refptr<ServiceWorkerContextWrapper> context);
// Shutdown must be called before deleting this. Call on the UI thread.
void Shutdown();
@@ -99,16 +100,28 @@ class CONTENT_EXPORT BackgroundFetchContext
blink::mojom::BackgroundFetchError error,
std::vector<BackgroundFetchRequestInfo> initial_requests);
- // Called when a the given |controller| has finished processing its job.
+ // Called when the given |controller| has finished processing its job.
void DidCompleteJob(BackgroundFetchJobController* controller);
+ // Called when the sequence of settled fetches for |registration_id| have been
+ // retrieved from storage, and the Service Worker event can be invoked.
+ void DidGetSettledFetches(
+ const BackgroundFetchRegistrationId& registration_id,
+ blink::mojom::BackgroundFetchError error,
+ std::vector<BackgroundFetchSettledFetch> settled_fetches,
+ std::vector<std::unique_ptr<BlobHandle>> blob_handles);
+
+ // Called when all processing for the |registration_id| has been finished and
+ // the job, including its associated data, is ready to be deleted.
+ void DeleteRegistration(const BackgroundFetchRegistrationId& registration_id);
+
// |this| is owned, indirectly, by the BrowserContext.
BrowserContext* browser_context_;
- scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
scoped_refptr<net::URLRequestContextGetter> request_context_;
- std::unique_ptr<BackgroundFetchDataManager> background_fetch_data_manager_;
+ std::unique_ptr<BackgroundFetchDataManager> data_manager_;
+ std::unique_ptr<BackgroundFetchEventDispatcher> event_dispatcher_;
// Map of the Background Fetch fetches that are currently in-progress.
std::map<BackgroundFetchRegistrationId,
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/background_fetch/background_fetch_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698