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

Unified Diff: content/child/service_worker/service_worker_dispatcher.cc

Issue 479123002: ServiceWorker: Remove macros that were used to introduce SWRegistration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/service_worker/service_worker_dispatcher.cc
diff --git a/content/child/service_worker/service_worker_dispatcher.cc b/content/child/service_worker/service_worker_dispatcher.cc
index 255c4bf518e9641e4e7ca2e908aeaef8c9e6857a..0522ea991395406e4234640dd7473e1db815f80e 100644
--- a/content/child/service_worker/service_worker_dispatcher.cc
+++ b/content/child/service_worker/service_worker_dispatcher.cc
@@ -247,17 +247,13 @@ void ServiceWorkerDispatcher::OnRegistered(
if (!callbacks)
return;
-#ifdef DISABLE_SERVICE_WORKER_REGISTRATION
- callbacks->onSuccess(GetServiceWorker(info, true));
- // We should adopt and destroy an unused handle ref.
- ServiceWorkerRegistrationHandleReference::Adopt(
- registration_handle_id, info, thread_safe_sender_);
-#else
callbacks->onSuccess(GetServiceWorkerRegistration(
registration_handle_id, info, true));
+
// We should adopt and destroy an unused handle ref.
falken 2014/08/18 06:41:39 not from this patch, but this comment says "should
nhiroki 2014/08/18 06:45:34 Done. Thanks!
+ // TODO(nhiroki): ServiceWorkerDispatcherHost don't have to pass a handle ref.
ServiceWorkerHandleReference::Adopt(info, thread_safe_sender_);
-#endif
+
pending_callbacks_.Remove(request_id);
}
@@ -348,21 +344,14 @@ void ServiceWorkerDispatcher::SetInstallingServiceWorker(
worker_to_provider_[info.handle_id] = provider->second;
}
-#ifdef DISABLE_SERVICE_WORKER_REGISTRATION
- ScriptClientMap::iterator found = script_clients_.find(provider_id);
- if (found != script_clients_.end()) {
- // Populate the .installing field with the new worker object.
- found->second->setInstalling(GetServiceWorker(info, false));
- }
-#else
RegistrationObjectMap::iterator found =
registrations_.find(registration_handle_id);
if (found != registrations_.end()) {
+ // Populate the .installing field with the new worker object.
found->second->setInstalling(GetServiceWorker(info, false));
if (info.handle_id != kInvalidServiceWorkerHandleId)
found->second->OnUpdateFound();
}
-#endif
}
void ServiceWorkerDispatcher::SetWaitingServiceWorker(
@@ -385,18 +374,12 @@ void ServiceWorkerDispatcher::SetWaitingServiceWorker(
worker_to_provider_[info.handle_id] = provider->second;
}
-#ifdef DISABLE_SERVICE_WORKER_REGISTRATION
- ScriptClientMap::iterator found = script_clients_.find(provider_id);
- if (found != script_clients_.end()) {
- // Populate the .waiting field with the new worker object.
- found->second->setWaiting(GetServiceWorker(info, false));
- }
-#else
RegistrationObjectMap::iterator found =
registrations_.find(registration_handle_id);
- if (found != registrations_.end())
+ if (found != registrations_.end()) {
+ // Populate the .waiting field with the new worker object.
found->second->setWaiting(GetServiceWorker(info, false));
-#endif
+ }
}
void ServiceWorkerDispatcher::SetActiveServiceWorker(
@@ -419,18 +402,12 @@ void ServiceWorkerDispatcher::SetActiveServiceWorker(
worker_to_provider_[info.handle_id] = provider->second;
}
-#ifdef DISABLE_SERVICE_WORKER_REGISTRATION
- ScriptClientMap::iterator found = script_clients_.find(provider_id);
- if (found != script_clients_.end()) {
- // Populate the .active field with the new worker object.
- found->second->setActive(GetServiceWorker(info, false));
- }
-#else
RegistrationObjectMap::iterator found =
registrations_.find(registration_handle_id);
- if (found != registrations_.end())
+ if (found != registrations_.end()) {
+ // Populate the .active field with the new worker object.
found->second->setActive(GetServiceWorker(info, false));
-#endif
+ }
}
void ServiceWorkerDispatcher::OnSetControllerServiceWorker(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698