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

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

Issue 702843004: Transfer serviceworker state during cross site navigations too. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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_request_handler.cc
diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc
index 6c871e6cd55ba588518b0f856964d472c927fb2a..d755ff94aeafe88317fc2a5a770de4c6d9e40d68 100644
--- a/content/browser/service_worker/service_worker_request_handler.cc
+++ b/content/browser/service_worker/service_worker_request_handler.cc
@@ -129,6 +129,28 @@ bool ServiceWorkerRequestHandler::IsControlledByServiceWorker(
handler->provider_host_->running_hosted_version();
}
+void ServiceWorkerRequestHandler::PrepareForCrossSiteTransfer(
+ int old_process_id) {
+ if (!provider_host_ || !context_)
+ return;
+ host_for_cross_site_transfer_ =
+ context_->TransferProviderHostOut(old_process_id,
+ provider_host_->provider_id());
+ DCHECK_EQ(provider_host_.get(), host_for_cross_site_transfer_.get());
+}
+
+void ServiceWorkerRequestHandler::CompleteCrossSiteTransfer(
+ int new_process_id, int new_host_id) {
+ if (!host_for_cross_site_transfer_.get() || !context_)
+ return;
+ DCHECK_EQ(provider_host_.get(), host_for_cross_site_transfer_.get());
+ context_->TransferProviderHostIn(
+ new_process_id,
+ new_host_id,
+ host_for_cross_site_transfer_.Pass());
+ DCHECK_EQ(provider_host_->provider_id(), new_host_id);
+}
+
ServiceWorkerRequestHandler::~ServiceWorkerRequestHandler() {
}

Powered by Google App Engine
This is Rietveld 408576698