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

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

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_data_manager.cc
diff --git a/content/browser/background_fetch/background_fetch_data_manager.cc b/content/browser/background_fetch/background_fetch_data_manager.cc
index f47bac8d0c80d83a4419f7bb94ee82ae3137b83a..b4d60f16581d34766878e12bf532aa8fb0175780 100644
--- a/content/browser/background_fetch/background_fetch_data_manager.cc
+++ b/content/browser/background_fetch/background_fetch_data_manager.cc
@@ -23,9 +23,13 @@ std::unique_ptr<BackgroundFetchJobData>
BackgroundFetchDataManager::CreateRequest(
std::unique_ptr<BackgroundFetchJobInfo> job_info,
BackgroundFetchRequestInfos request_infos) {
- JobIdentifier id(job_info->service_worker_registration_id(), job_info->tag());
+ BackgroundFetchRegistrationId registration_id(
+ job_info->service_worker_registration_id(), job_info->origin(),
+ job_info->tag());
+
// Ensure that this is not a duplicate request.
- if (service_worker_tag_map_.find(id) != service_worker_tag_map_.end()) {
+ if (known_registrations_.find(registration_id) !=
+ known_registrations_.end()) {
DVLOG(1) << "Origin " << job_info->origin()
<< " has already created a batch request with tag "
<< job_info->tag();
@@ -36,7 +40,7 @@ BackgroundFetchDataManager::CreateRequest(
// Add the request to our maps and return a JobData to track the individual
// files in the request.
const std::string job_guid = job_info->guid();
- service_worker_tag_map_[id] = job_guid;
+ known_registrations_.insert(std::move(registration_id));
WriteJobToStorage(std::move(job_info), std::move(request_infos));
// TODO(harkness): Remove data when the job is complete.

Powered by Google App Engine
This is Rietveld 408576698