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

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

Issue 2638313002: Manage ServiceWorkerDispatcherHost in ServiceWorkerContextCore (Closed)
Patch Set: Rebase Created 3 years, 10 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 | « content/child/service_worker/service_worker_network_provider.h ('k') | content/common/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9e36b7d41cdabc50f686860e94e39510a721abf3..555f50913af750755f3f146362e70e2ea01a9c99 100644
--- a/content/child/service_worker/service_worker_network_provider.cc
+++ b/content/child/service_worker/service_worker_network_provider.cc
@@ -9,6 +9,7 @@
#include "content/child/service_worker/service_worker_provider_context.h"
#include "content/common/navigation_params.h"
#include "content/common/service_worker/service_worker_messages.h"
+#include "content/common/service_worker/service_worker_provider_host_info.h"
#include "content/common/service_worker/service_worker_utils.h"
#include "content/public/common/browser_side_navigation_policy.h"
#include "ipc/ipc_sync_channel.h"
@@ -126,18 +127,14 @@ ServiceWorkerNetworkProvider::ServiceWorkerNetworkProvider(
return;
if (!ChildThreadImpl::current())
return; // May be null in some tests.
+ ServiceWorkerProviderHostInfo provider_info(
+ provider_id_, route_id, provider_type, is_parent_frame_secure);
context_ = new ServiceWorkerProviderContext(
provider_id_, provider_type,
ChildThreadImpl::current()->thread_safe_sender());
- if (ServiceWorkerUtils::IsMojoForServiceWorkerEnabled()) {
- ChildThreadImpl::current()->channel()->GetRemoteAssociatedInterface(
- &dispatcher_host_);
- dispatcher_host_->OnProviderCreated(provider_id_, route_id, provider_type,
- is_parent_frame_secure);
- } else {
- ChildThreadImpl::current()->Send(new ServiceWorkerHostMsg_ProviderCreated(
- provider_id_, route_id, provider_type, is_parent_frame_secure));
- }
+ ChildThreadImpl::current()->channel()->GetRemoteAssociatedInterface(
+ &dispatcher_host_);
+ dispatcher_host_->OnProviderCreated(std::move(provider_info));
}
ServiceWorkerNetworkProvider::ServiceWorkerNetworkProvider(
@@ -157,12 +154,7 @@ ServiceWorkerNetworkProvider::~ServiceWorkerNetworkProvider() {
return;
if (!ChildThreadImpl::current())
return; // May be null in some tests.
- if (ServiceWorkerUtils::IsMojoForServiceWorkerEnabled()) {
- dispatcher_host_->OnProviderDestroyed(provider_id());
- } else {
- ChildThreadImpl::current()->Send(
- new ServiceWorkerHostMsg_ProviderDestroyed(provider_id_));
- }
+ dispatcher_host_->OnProviderDestroyed(provider_id());
}
void ServiceWorkerNetworkProvider::SetServiceWorkerVersionId(
@@ -171,13 +163,8 @@ void ServiceWorkerNetworkProvider::SetServiceWorkerVersionId(
DCHECK_NE(kInvalidServiceWorkerProviderId, provider_id_);
if (!ChildThreadImpl::current())
return; // May be null in some tests.
- 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));
- }
+ dispatcher_host_->OnSetHostedVersionId(provider_id(), version_id,
+ embedded_worker_id);
}
bool ServiceWorkerNetworkProvider::IsControlledByServiceWorker() const {
« no previous file with comments | « content/child/service_worker/service_worker_network_provider.h ('k') | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698