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

Unified Diff: content/browser/service_worker/service_worker_provider_host.cc

Issue 1181573010: ServiceWorker: Fix matching registration info missing during shift-reload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/service_worker/service_worker_provider_host.cc
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc
index 599047519bc3e313936a6e6c7b1b44f56bd9c907..3519c1fa170aa0ff7ae63dc68b191d56e0d20010 100644
--- a/content/browser/service_worker/service_worker_provider_host.cc
+++ b/content/browser/service_worker/service_worker_provider_host.cc
@@ -302,6 +302,21 @@ ServiceWorkerProviderHost::MatchRegistration() const {
return nullptr;
}
+void ServiceWorkerProviderHost::CopyMatchingRegistrations() {
+ for (scoped_ptr<ServiceWorkerContextCore::ProviderHostIterator> it =
+ context_->GetProviderHostIterator();
+ !it->IsAtEnd(); it->Advance()) {
+ ServiceWorkerProviderHost* host = it->GetProviderHost();
michaeln 2015/06/17 21:20:14 need to compare host process_ids as well
xiang 2015/06/19 07:43:24 Done.
+ if (host->render_frame_id_ != render_frame_id_)
+ continue;
+ if (host->document_url_ != document_url_)
+ continue;
falken 2015/06/17 15:08:35 I wonder if we can really be sure an old provider
michaeln 2015/06/17 21:20:14 In the reload case, there will be an old provider,
xiang 2015/06/19 07:43:24 I feel finding the old SWPH maybe faster than get
michaeln 2015/06/22 20:33:52 I think agree with falken about doing this as AddM
xiang 2015/06/23 09:01:36 Thanks for the suggestion, CL changed.
+ for (auto& key_registration : host->matching_registrations_)
+ AddMatchingRegistration(key_registration.second.get());
+ break;
+ }
+}
+
void ServiceWorkerProviderHost::NotifyControllerLost() {
SetControllerVersionAttribute(nullptr, true /* notify_controllerchange */);
}

Powered by Google App Engine
This is Rietveld 408576698