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

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

Issue 2527883002: ServiceWorker: mojofy ipcs sent from SWNetworkProvider (Closed)
Patch Set: Created 4 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/child/service_worker/service_worker_network_provider.cc
diff --git a/content/child/service_worker/service_worker_network_provider.cc b/content/child/service_worker/service_worker_network_provider.cc
index baa6f6317b5ce66026967e0066104129966c6fb5..9e36b7d41cdabc50f686860e94e39510a721abf3 100644
--- a/content/child/service_worker/service_worker_network_provider.cc
+++ b/content/child/service_worker/service_worker_network_provider.cc
@@ -157,8 +157,12 @@ ServiceWorkerNetworkProvider::~ServiceWorkerNetworkProvider() {
return;
if (!ChildThreadImpl::current())
return; // May be null in some tests.
- ChildThreadImpl::current()->Send(
- new ServiceWorkerHostMsg_ProviderDestroyed(provider_id_));
+ if (ServiceWorkerUtils::IsMojoForServiceWorkerEnabled()) {
+ dispatcher_host_->OnProviderDestroyed(provider_id());
+ } else {
+ ChildThreadImpl::current()->Send(
+ new ServiceWorkerHostMsg_ProviderDestroyed(provider_id_));
+ }
}
void ServiceWorkerNetworkProvider::SetServiceWorkerVersionId(
@@ -167,8 +171,13 @@ void ServiceWorkerNetworkProvider::SetServiceWorkerVersionId(
DCHECK_NE(kInvalidServiceWorkerProviderId, provider_id_);
if (!ChildThreadImpl::current())
return; // May be null in some tests.
- ChildThreadImpl::current()->Send(new ServiceWorkerHostMsg_SetVersionId(
- provider_id_, version_id, embedded_worker_id));
+ if (ServiceWorkerUtils::IsMojoForServiceWorkerEnabled()) {
+ dispatcher_host_->OnSetHostedVersionId(provider_id(), version_id,
+ embedded_worker_id);
+ } else {
+ ChildThreadImpl::current()->Send(new ServiceWorkerHostMsg_SetVersionId(
+ provider_id_, version_id, embedded_worker_id));
+ }
}
bool ServiceWorkerNetworkProvider::IsControlledByServiceWorker() const {
« no previous file with comments | « content/browser/service_worker/service_worker_dispatcher_host.h ('k') | content/common/service_worker/service_worker.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698