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

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

Issue 1221643014: Service Worker: Migrate to version_uuid and surface ServiceWorker.id. (Chromium 2/3) (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_dispatcher_host.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
index fc102749e40f46541e6d97761823605f534649ea..22332dddfa40df4119fee50464a7b6b17750eae4 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -249,14 +249,14 @@ void ServiceWorkerDispatcherHost::RegisterServiceWorkerRegistrationHandle(
ServiceWorkerHandle* ServiceWorkerDispatcherHost::FindServiceWorkerHandle(
int provider_id,
- int64 version_id) {
+ std::string version_uuid) {
for (IDMap<ServiceWorkerHandle, IDMapOwnPointer>::iterator iter(&handles_);
!iter.IsAtEnd(); iter.Advance()) {
ServiceWorkerHandle* handle = iter.GetCurrentValue();
DCHECK(handle);
DCHECK(handle->version());
if (handle->provider_id() == provider_id &&
- handle->version()->version_id() == version_id) {
+ handle->version()->version_uuid().compare(version_uuid) == 0) {
return handle;
}
}
@@ -734,7 +734,8 @@ void ServiceWorkerDispatcherHost::OnProviderDestroyed(int provider_id) {
}
void ServiceWorkerDispatcherHost::OnSetHostedVersionId(
- int provider_id, int64 version_id) {
+ int provider_id,
+ std::string version_uuid) {
TRACE_EVENT0("ServiceWorker",
"ServiceWorkerDispatcherHost::OnSetHostedVersionId");
if (!GetContext())
@@ -748,10 +749,10 @@ void ServiceWorkerDispatcherHost::OnSetHostedVersionId(
}
if (!provider_host->IsContextAlive())
return;
- if (!provider_host->SetHostedVersionId(version_id))
+ if (!provider_host->SetHostedVersionId(version_uuid))
bad_message::ReceivedBadMessage(this, bad_message::SWDH_SET_HOSTED_VERSION);
- ServiceWorkerVersion* version = GetContext()->GetLiveVersion(version_id);
+ ServiceWorkerVersion* version = GetContext()->GetLiveVersion(version_uuid);
if (!version)
return;

Powered by Google App Engine
This is Rietveld 408576698