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

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

Issue 2770393003: Add a type to uniquely identify a Background Fetch (Closed)
Patch Set: 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_event_dispatcher.h
diff --git a/content/browser/background_fetch/background_fetch_event_dispatcher.h b/content/browser/background_fetch/background_fetch_event_dispatcher.h
index 24a5933d4639d0baf45b94cb5b0b2b25ca36b530..9d781ef756835f840e5172f6e29d157af417e55d 100644
--- a/content/browser/background_fetch/background_fetch_event_dispatcher.h
+++ b/content/browser/background_fetch/background_fetch_event_dispatcher.h
@@ -17,6 +17,7 @@
namespace content {
+class BackgroundFetchRegistrationId;
struct BackgroundFetchSettledFetch;
class ServiceWorkerContextWrapper;
class ServiceWorkerRegistration;
@@ -42,35 +43,29 @@ class CONTENT_EXPORT BackgroundFetchEventDispatcher {
// Dispatches the `backgroundfetchabort` event, which indicates that an active
// background fetch was aborted by the user or another external event.
- void DispatchBackgroundFetchAbortEvent(int64_t service_worker_registration_id,
- const GURL& origin,
- const std::string& tag,
- base::Closure finished_closure);
+ void DispatchBackgroundFetchAbortEvent(
+ const BackgroundFetchRegistrationId& registration_id,
+ base::Closure finished_closure);
// Dispatches the `backgroundfetchclick` event, which indicates that the user
// interface displayed for an active background fetch was activated.
- void DispatchBackgroundFetchClickEvent(int64_t service_worker_registration_id,
- const GURL& origin,
- const std::string& tag,
- mojom::BackgroundFetchState state,
- base::Closure finished_closure);
+ void DispatchBackgroundFetchClickEvent(
+ const BackgroundFetchRegistrationId& registration_id,
+ mojom::BackgroundFetchState state,
+ base::Closure finished_closure);
// Dispatches the `backgroundfetchfail` event, which indicates that a
// background fetch has finished with one or more failed fetches. The request-
// response pairs are included.
void DispatchBackgroundFetchFailEvent(
- int64_t service_worker_registration_id,
- const GURL& origin,
- const std::string& tag,
+ const BackgroundFetchRegistrationId& registration_id,
const std::vector<BackgroundFetchSettledFetch>& fetches,
base::Closure finished_closure);
// Dispatches the `backgroundfetched` event, which indicates that a background
// fetch has successfully completed. The request-response pairs are included.
void DispatchBackgroundFetchedEvent(
- int64_t service_worker_registration_id,
- const GURL& origin,
- const std::string& tag,
+ const BackgroundFetchRegistrationId& registration_id,
const std::vector<BackgroundFetchSettledFetch>& fetches,
base::Closure finished_closure);
@@ -81,13 +76,12 @@ class CONTENT_EXPORT BackgroundFetchEventDispatcher {
// Phase at which the dispatching process finished. Used for UMA.
enum class DispatchPhase { FINDING, STARTING, DISPATCHING };
- // Loads the Service Worker identified by |service_worker_registration_id| and
+ // Loads the Service Worker identified included in the |registration_id| and
// ensures that there is an activated version. Will invoke |finished_closure|,
// log UMA and abort on error, or invoke |loaded_callback| on success.
void LoadServiceWorkerRegistrationForDispatch(
+ const BackgroundFetchRegistrationId& registration_id,
ServiceWorkerMetrics::EventType event,
- int64_t service_worker_registration_id,
- const GURL& origin,
base::Closure finished_closure,
ServiceWorkerLoadedCallback loaded_callback);

Powered by Google App Engine
This is Rietveld 408576698