Index: content/browser/service_worker/service_worker_context_core.cc |
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc |
index 45f0a2dcc939c8c0660090efc782a0afd81be459..ec97d0146f854c87a28beb1392eb0780807e1dda 100644 |
--- a/content/browser/service_worker/service_worker_context_core.cc |
+++ b/content/browser/service_worker/service_worker_context_core.cc |
@@ -517,6 +517,33 @@ ServiceWorkerVersion* ServiceWorkerContextCore::GetLiveVersion( |
return (it != live_versions_.end()) ? it->second : NULL; |
} |
+// PlzNavigate |
+void ServiceWorkerContextCore::AddNavigationHandleCore( |
+ int service_worker_provider_id, |
+ ServiceWorkerNavigationHandleCore* handle) { |
+ auto result = navigation_handle_cores_map_.insert( |
+ std::pair<int, ServiceWorkerNavigationHandleCore*>( |
+ service_worker_provider_id, handle)); |
+ DCHECK(result.second) |
+ << "Inserting a duplicate ServiceWorkerNavigationHandleCore"; |
+} |
+ |
+// PlzNavigate |
+void ServiceWorkerContextCore::RemoveNavigationHandleCore( |
+ int service_worker_provider_id) { |
+ navigation_handle_cores_map_.erase(service_worker_provider_id); |
+} |
+ |
+// PlzNavigate |
+ServiceWorkerNavigationHandleCore* |
+ServiceWorkerContextCore::GetNavigationHandleCore( |
+ int service_worker_provider_id) { |
+ auto result = navigation_handle_cores_map_.find(service_worker_provider_id); |
+ if (result == navigation_handle_cores_map_.end()) |
+ return nullptr; |
+ return result->second; |
+} |
+ |
void ServiceWorkerContextCore::AddLiveVersion(ServiceWorkerVersion* version) { |
// TODO(horo): If we will see crashes here, we have to find the root cause of |
// the version ID conflict. Otherwise change CHECK to DCHECK. |