Commit 1811ccf0 authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

Rename ServiceWorkerNavigationHandle to ServiceWorkerMainResourceHandle.

As the comment in service_worker_navigation_handle.h, rename
ServiceWorkerNavigationHandle to ServiceWorkerMainResourceHandle.

This CL has no behavior changes.

Change-Id: I44ace8344e6feff740dc89517bafbb96d9c1b229
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1982513Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Commit-Queue: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Cr-Commit-Position: refs/heads/master@{#728460}
parent 51a065dd
...@@ -1655,12 +1655,12 @@ jumbo_source_set("browser") { ...@@ -1655,12 +1655,12 @@ jumbo_source_set("browser") {
"service_worker/service_worker_job_coordinator.h", "service_worker/service_worker_job_coordinator.h",
"service_worker/service_worker_loader_helpers.cc", "service_worker/service_worker_loader_helpers.cc",
"service_worker/service_worker_loader_helpers.h", "service_worker/service_worker_loader_helpers.h",
"service_worker/service_worker_main_resource_handle.cc",
"service_worker/service_worker_main_resource_handle.h",
"service_worker/service_worker_main_resource_handle_core.cc",
"service_worker/service_worker_main_resource_handle_core.h",
"service_worker/service_worker_metrics.cc", "service_worker/service_worker_metrics.cc",
"service_worker/service_worker_metrics.h", "service_worker/service_worker_metrics.h",
"service_worker/service_worker_navigation_handle.cc",
"service_worker/service_worker_navigation_handle.h",
"service_worker/service_worker_navigation_handle_core.cc",
"service_worker/service_worker_navigation_handle_core.h",
"service_worker/service_worker_navigation_loader.cc", "service_worker/service_worker_navigation_loader.cc",
"service_worker/service_worker_navigation_loader.h", "service_worker/service_worker_navigation_loader.h",
"service_worker/service_worker_navigation_loader_interceptor.cc", "service_worker/service_worker_navigation_loader_interceptor.cc",
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/site_instance_impl.h" #include "content/browser/site_instance_impl.h"
#include "content/browser/web_package/prefetched_signed_exchange_cache.h" #include "content/browser/web_package/prefetched_signed_exchange_cache.h"
#include "content/browser/web_package/web_bundle_handle_tracker.h" #include "content/browser/web_package/web_bundle_handle_tracker.h"
...@@ -2010,8 +2010,8 @@ void NavigationRequest::OnStartChecksComplete( ...@@ -2010,8 +2010,8 @@ void NavigationRequest::OnStartChecksComplete(
// comment in the header for |loader_|. // comment in the header for |loader_|.
DCHECK(!loader_); DCHECK(!loader_);
// Only initialize the ServiceWorkerNavigationHandle if it can be created for // Only initialize the ServiceWorkerMainResourceHandle if it can be created
// this frame. // for this frame.
bool can_create_service_worker = bool can_create_service_worker =
(frame_tree_node_->pending_frame_policy().sandbox_flags & (frame_tree_node_->pending_frame_policy().sandbox_flags &
blink::WebSandboxFlags::kOrigin) != blink::WebSandboxFlags::kOrigin; blink::WebSandboxFlags::kOrigin) != blink::WebSandboxFlags::kOrigin;
...@@ -2019,8 +2019,8 @@ void NavigationRequest::OnStartChecksComplete( ...@@ -2019,8 +2019,8 @@ void NavigationRequest::OnStartChecksComplete(
ServiceWorkerContextWrapper* service_worker_context = ServiceWorkerContextWrapper* service_worker_context =
static_cast<ServiceWorkerContextWrapper*>( static_cast<ServiceWorkerContextWrapper*>(
partition->GetServiceWorkerContext()); partition->GetServiceWorkerContext());
service_worker_handle_ = service_worker_handle_ = std::make_unique<ServiceWorkerMainResourceHandle>(
std::make_unique<ServiceWorkerNavigationHandle>(service_worker_context); service_worker_context);
} }
if (IsSchemeSupportedForAppCache(common_params_->url)) { if (IsSchemeSupportedForAppCache(common_params_->url)) {
......
...@@ -65,7 +65,7 @@ class NavigationURLLoader; ...@@ -65,7 +65,7 @@ class NavigationURLLoader;
class NavigationUIData; class NavigationUIData;
class NavigatorDelegate; class NavigatorDelegate;
class PrefetchedSignedExchangeCache; class PrefetchedSignedExchangeCache;
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
class SiteInstanceImpl; class SiteInstanceImpl;
struct SubresourceLoaderParams; struct SubresourceLoaderParams;
...@@ -1063,7 +1063,7 @@ class CONTENT_EXPORT NavigationRequest ...@@ -1063,7 +1063,7 @@ class CONTENT_EXPORT NavigationRequest
// Manages the lifetime of a pre-created ServiceWorkerProviderHost until a // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a
// corresponding provider is created in the renderer. // corresponding provider is created in the renderer.
std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; std::unique_ptr<ServiceWorkerMainResourceHandle> service_worker_handle_;
// Timer for detecting an unexpectedly long time to commit a navigation. // Timer for detecting an unexpectedly long time to commit a navigation.
base::OneShotTimer commit_timeout_timer_; base::OneShotTimer commit_timeout_timer_;
......
...@@ -25,7 +25,7 @@ std::unique_ptr<NavigationURLLoader> NavigationURLLoader::Create( ...@@ -25,7 +25,7 @@ std::unique_ptr<NavigationURLLoader> NavigationURLLoader::Create(
StoragePartition* storage_partition, StoragePartition* storage_partition,
std::unique_ptr<NavigationRequestInfo> request_info, std::unique_ptr<NavigationRequestInfo> request_info,
std::unique_ptr<NavigationUIData> navigation_ui_data, std::unique_ptr<NavigationUIData> navigation_ui_data,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
AppCacheNavigationHandle* appcache_handle, AppCacheNavigationHandle* appcache_handle,
scoped_refptr<PrefetchedSignedExchangeCache> scoped_refptr<PrefetchedSignedExchangeCache>
prefetched_signed_exchange_cache, prefetched_signed_exchange_cache,
......
...@@ -27,7 +27,7 @@ class NavigationUIData; ...@@ -27,7 +27,7 @@ class NavigationUIData;
class NavigationURLLoaderDelegate; class NavigationURLLoaderDelegate;
class NavigationURLLoaderFactory; class NavigationURLLoaderFactory;
class PrefetchedSignedExchangeCache; class PrefetchedSignedExchangeCache;
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
class StoragePartition; class StoragePartition;
struct NavigationRequestInfo; struct NavigationRequestInfo;
...@@ -53,7 +53,7 @@ class CONTENT_EXPORT NavigationURLLoader { ...@@ -53,7 +53,7 @@ class CONTENT_EXPORT NavigationURLLoader {
StoragePartition* storage_partition, StoragePartition* storage_partition,
std::unique_ptr<NavigationRequestInfo> request_info, std::unique_ptr<NavigationRequestInfo> request_info,
std::unique_ptr<NavigationUIData> navigation_ui_data, std::unique_ptr<NavigationUIData> navigation_ui_data,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
AppCacheNavigationHandle* appcache_handle, AppCacheNavigationHandle* appcache_handle,
scoped_refptr<PrefetchedSignedExchangeCache> scoped_refptr<PrefetchedSignedExchangeCache>
prefetched_signed_exchange_cache, prefetched_signed_exchange_cache,
......
...@@ -20,7 +20,7 @@ class NavigationURLLoaderFactory { ...@@ -20,7 +20,7 @@ class NavigationURLLoaderFactory {
StoragePartition* storage_partition, StoragePartition* storage_partition,
std::unique_ptr<NavigationRequestInfo> request_info, std::unique_ptr<NavigationRequestInfo> request_info,
std::unique_ptr<NavigationUIData> navigation_ui_data, std::unique_ptr<NavigationUIData> navigation_ui_data,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
NavigationURLLoaderDelegate* delegate, NavigationURLLoaderDelegate* delegate,
bool is_served_from_back_forward_cache) = 0; bool is_served_from_back_forward_cache) = 0;
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
#include "content/browser/loader/single_request_url_loader_factory.h" #include "content/browser/loader/single_request_url_loader_factory.h"
#include "content/browser/navigation_subresource_loader_params.h" #include "content/browser/navigation_subresource_loader_params.h"
#include "content/browser/service_worker/service_worker_container_host.h" #include "content/browser/service_worker/service_worker_container_host.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_navigation_handle_core.h" #include "content/browser/service_worker/service_worker_main_resource_handle_core.h"
#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_provider_host.h"
#include "content/browser/service_worker/service_worker_request_handler.h" #include "content/browser/service_worker/service_worker_request_handler.h"
#include "content/browser/storage_partition_impl.h" #include "content/browser/storage_partition_impl.h"
...@@ -410,10 +410,10 @@ class NavigationURLLoaderImpl::URLLoaderRequestController ...@@ -410,10 +410,10 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
void Start( void Start(
std::unique_ptr<network::PendingSharedURLLoaderFactory> std::unique_ptr<network::PendingSharedURLLoaderFactory>
pending_network_loader_factory, pending_network_loader_factory,
ServiceWorkerNavigationHandle* ServiceWorkerMainResourceHandle*
service_worker_navigation_handle /* for UI thread only */, service_worker_handle /* for UI thread only */,
ServiceWorkerNavigationHandleCore* ServiceWorkerMainResourceHandleCore*
service_worker_navigation_handle_core /* for IO thread only */, service_worker_handle_core /* for IO thread only */,
AppCacheNavigationHandle* appcache_handle, AppCacheNavigationHandle* appcache_handle,
scoped_refptr<PrefetchedSignedExchangeCache> scoped_refptr<PrefetchedSignedExchangeCache>
prefetched_signed_exchange_cache, prefetched_signed_exchange_cache,
...@@ -434,7 +434,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController ...@@ -434,7 +434,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
web_contents_getter_ = base::BindRepeating( web_contents_getter_ = base::BindRepeating(
&WebContents::FromFrameTreeNodeId, frame_tree_node_id_); &WebContents::FromFrameTreeNodeId, frame_tree_node_id_);
navigation_ui_data_ = std::move(navigation_ui_data); navigation_ui_data_ = std::move(navigation_ui_data);
service_worker_navigation_handle_ = service_worker_navigation_handle; service_worker_handle_ = service_worker_handle;
base::PostTask(FROM_HERE, {BrowserThread::UI}, base::PostTask(FROM_HERE, {BrowserThread::UI},
base::BindOnce(&NavigationURLLoaderImpl::OnRequestStarted, base::BindOnce(&NavigationURLLoaderImpl::OnRequestStarted,
...@@ -515,11 +515,11 @@ class NavigationURLLoaderImpl::URLLoaderRequestController ...@@ -515,11 +515,11 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
} }
// Set up an interceptor for service workers. // Set up an interceptor for service workers.
if (service_worker_navigation_handle_) { if (service_worker_handle_) {
std::unique_ptr<NavigationLoaderInterceptor> service_worker_interceptor = std::unique_ptr<NavigationLoaderInterceptor> service_worker_interceptor =
ServiceWorkerRequestHandler::CreateForNavigation( ServiceWorkerRequestHandler::CreateForNavigation(
resource_request_->url, resource_request_->url, service_worker_handle_->AsWeakPtr(),
service_worker_navigation_handle_->AsWeakPtr(), *request_info); *request_info);
// The interceptor may not be created in certain cases (e.g., the origin // The interceptor may not be created in certain cases (e.g., the origin
// is not secure). // is not secure).
if (service_worker_interceptor) if (service_worker_interceptor)
...@@ -1105,11 +1105,11 @@ class NavigationURLLoaderImpl::URLLoaderRequestController ...@@ -1105,11 +1105,11 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
// Service Worker related APIs will fail with NoDocumentURL error. // Service Worker related APIs will fail with NoDocumentURL error.
// TODO(crbug/898733): Support SignedExchange loading and Service // TODO(crbug/898733): Support SignedExchange loading and Service
// Worker integration. // Worker integration.
if (service_worker_navigation_handle_) { if (service_worker_handle_) {
RunOrPostTaskOnThread( RunOrPostTaskOnThread(
FROM_HERE, ServiceWorkerContext::GetCoreThreadId(), FROM_HERE, ServiceWorkerContext::GetCoreThreadId(),
base::BindOnce( base::BindOnce(
[](ServiceWorkerNavigationHandleCore* core) { [](ServiceWorkerMainResourceHandleCore* core) {
base::WeakPtr<ServiceWorkerContainerHost> container_host = base::WeakPtr<ServiceWorkerContainerHost> container_host =
core->container_host(); core->container_host();
if (container_host) { if (container_host) {
...@@ -1122,8 +1122,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController ...@@ -1122,8 +1122,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
// Unretained() is safe because the handle owns the core, // Unretained() is safe because the handle owns the core,
// and core gets deleted on the core thread in a task that // and core gets deleted on the core thread in a task that
// must occur after this task. // must occur after this task.
base::Unretained( base::Unretained(service_worker_handle_->core())));
service_worker_navigation_handle_->core())));
} }
} }
return true; return true;
...@@ -1260,7 +1259,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController ...@@ -1260,7 +1259,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
// Used to reset the state of ServiceWorkerProviderHost when // Used to reset the state of ServiceWorkerProviderHost when
// SignedExchangeRequestHandler will handle the response. // SignedExchangeRequestHandler will handle the response.
base::WeakPtr<ServiceWorkerProviderHost> service_worker_provider_host_; base::WeakPtr<ServiceWorkerProviderHost> service_worker_provider_host_;
ServiceWorkerNavigationHandle* service_worker_navigation_handle_ = nullptr; ServiceWorkerMainResourceHandle* service_worker_handle_ = nullptr;
// Counts the time overhead of all the hops from the UI to the IO threads. // Counts the time overhead of all the hops from the UI to the IO threads.
base::TimeDelta ui_to_io_time_; base::TimeDelta ui_to_io_time_;
...@@ -1283,7 +1282,7 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl( ...@@ -1283,7 +1282,7 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl(
StoragePartition* storage_partition, StoragePartition* storage_partition,
std::unique_ptr<NavigationRequestInfo> request_info, std::unique_ptr<NavigationRequestInfo> request_info,
std::unique_ptr<NavigationUIData> navigation_ui_data, std::unique_ptr<NavigationUIData> navigation_ui_data,
ServiceWorkerNavigationHandle* service_worker_navigation_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
AppCacheNavigationHandle* appcache_handle, AppCacheNavigationHandle* appcache_handle,
scoped_refptr<PrefetchedSignedExchangeCache> scoped_refptr<PrefetchedSignedExchangeCache>
prefetched_signed_exchange_cache, prefetched_signed_exchange_cache,
...@@ -1300,10 +1299,8 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl( ...@@ -1300,10 +1299,8 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl(
request_info->common_params->navigation_start, "FrameTreeNode id", request_info->common_params->navigation_start, "FrameTreeNode id",
frame_tree_node_id); frame_tree_node_id);
ServiceWorkerNavigationHandleCore* service_worker_navigation_handle_core = ServiceWorkerMainResourceHandleCore* service_worker_handle_core =
service_worker_navigation_handle service_worker_handle ? service_worker_handle->core() : nullptr;
? service_worker_navigation_handle->core()
: nullptr;
std::unique_ptr<network::ResourceRequest> new_request = std::unique_ptr<network::ResourceRequest> new_request =
CreateResourceRequest(request_info.get(), frame_tree_node_id); CreateResourceRequest(request_info.get(), frame_tree_node_id);
...@@ -1443,8 +1440,8 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl( ...@@ -1443,8 +1440,8 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl(
std::move(known_schemes), bypass_redirect_checks, std::move(known_schemes), bypass_redirect_checks,
weak_factory_.GetWeakPtr()); weak_factory_.GetWeakPtr());
request_controller_->Start( request_controller_->Start(
std::move(pending_network_factory), service_worker_navigation_handle, std::move(pending_network_factory), service_worker_handle,
service_worker_navigation_handle_core, appcache_handle, service_worker_handle_core, appcache_handle,
std::move(prefetched_signed_exchange_cache), std::move(prefetched_signed_exchange_cache),
std::move(signed_exchange_prefetch_metric_recorder), std::move(signed_exchange_prefetch_metric_recorder),
std::move(request_info), std::move(navigation_ui_data), std::move(request_info), std::move(navigation_ui_data),
......
...@@ -42,7 +42,7 @@ class CONTENT_EXPORT NavigationURLLoaderImpl : public NavigationURLLoader { ...@@ -42,7 +42,7 @@ class CONTENT_EXPORT NavigationURLLoaderImpl : public NavigationURLLoader {
StoragePartition* storage_partition, StoragePartition* storage_partition,
std::unique_ptr<NavigationRequestInfo> request_info, std::unique_ptr<NavigationRequestInfo> request_info,
std::unique_ptr<NavigationUIData> navigation_ui_data, std::unique_ptr<NavigationUIData> navigation_ui_data,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
AppCacheNavigationHandle* appcache_handle, AppCacheNavigationHandle* appcache_handle,
scoped_refptr<PrefetchedSignedExchangeCache> scoped_refptr<PrefetchedSignedExchangeCache>
prefetched_signed_exchange_cache, prefetched_signed_exchange_cache,
......
...@@ -337,7 +337,7 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper ...@@ -337,7 +337,7 @@ class CONTENT_EXPORT ServiceWorkerContextWrapper
friend class FakeServiceWorkerContextWrapper; friend class FakeServiceWorkerContextWrapper;
friend class ServiceWorkerClientsApiBrowserTest; friend class ServiceWorkerClientsApiBrowserTest;
friend class ServiceWorkerInternalsUI; friend class ServiceWorkerInternalsUI;
friend class ServiceWorkerNavigationHandleCore; friend class ServiceWorkerMainResourceHandleCore;
friend class ServiceWorkerProcessManager; friend class ServiceWorkerProcessManager;
friend class ServiceWorkerRequestHandler; friend class ServiceWorkerRequestHandler;
friend class ServiceWorkerVersionBrowserTest; friend class ServiceWorkerVersionBrowserTest;
......
...@@ -2,36 +2,36 @@ ...@@ -2,36 +2,36 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include <utility> #include <utility>
#include "base/bind.h" #include "base/bind.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle_core.h" #include "content/browser/service_worker/service_worker_main_resource_handle_core.h"
#include "content/common/service_worker/service_worker_utils.h" #include "content/common/service_worker/service_worker_utils.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
namespace content { namespace content {
ServiceWorkerNavigationHandle::ServiceWorkerNavigationHandle( ServiceWorkerMainResourceHandle::ServiceWorkerMainResourceHandle(
ServiceWorkerContextWrapper* context_wrapper) ServiceWorkerContextWrapper* context_wrapper)
: context_wrapper_(context_wrapper) { : context_wrapper_(context_wrapper) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
core_ = new ServiceWorkerNavigationHandleCore(weak_factory_.GetWeakPtr(), core_ = new ServiceWorkerMainResourceHandleCore(weak_factory_.GetWeakPtr(),
context_wrapper); context_wrapper);
} }
ServiceWorkerNavigationHandle::~ServiceWorkerNavigationHandle() { ServiceWorkerMainResourceHandle::~ServiceWorkerMainResourceHandle() {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Delete the ServiceWorkerNavigationHandleCore on the core thread. // Delete the ServiceWorkerMainResourceHandleCore on the core thread.
BrowserThread::DeleteSoon(ServiceWorkerContext::GetCoreThreadId(), FROM_HERE, BrowserThread::DeleteSoon(ServiceWorkerContext::GetCoreThreadId(), FROM_HERE,
core_); core_);
} }
void ServiceWorkerNavigationHandle::OnCreatedProviderHost( void ServiceWorkerMainResourceHandle::OnCreatedProviderHost(
blink::mojom::ServiceWorkerProviderInfoForClientPtr provider_info) { blink::mojom::ServiceWorkerProviderInfoForClientPtr provider_info) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(provider_info->host_remote.is_valid() && DCHECK(provider_info->host_remote.is_valid() &&
...@@ -40,7 +40,7 @@ void ServiceWorkerNavigationHandle::OnCreatedProviderHost( ...@@ -40,7 +40,7 @@ void ServiceWorkerNavigationHandle::OnCreatedProviderHost(
provider_info_ = std::move(provider_info); provider_info_ = std::move(provider_info);
} }
void ServiceWorkerNavigationHandle::OnBeginNavigationCommit( void ServiceWorkerMainResourceHandle::OnBeginNavigationCommit(
int render_process_id, int render_process_id,
int render_frame_id, int render_frame_id,
network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy, network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy,
...@@ -52,18 +52,18 @@ void ServiceWorkerNavigationHandle::OnBeginNavigationCommit( ...@@ -52,18 +52,18 @@ void ServiceWorkerNavigationHandle::OnBeginNavigationCommit(
ServiceWorkerContextWrapper::RunOrPostTaskOnCoreThread( ServiceWorkerContextWrapper::RunOrPostTaskOnCoreThread(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
&ServiceWorkerNavigationHandleCore::OnBeginNavigationCommit, &ServiceWorkerMainResourceHandleCore::OnBeginNavigationCommit,
base::Unretained(core_), render_process_id, render_frame_id, base::Unretained(core_), render_process_id, render_frame_id,
cross_origin_embedder_policy)); cross_origin_embedder_policy));
*out_provider_info = std::move(provider_info_); *out_provider_info = std::move(provider_info_);
} }
void ServiceWorkerNavigationHandle::OnBeginWorkerCommit( void ServiceWorkerMainResourceHandle::OnBeginWorkerCommit(
network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy) { network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
ServiceWorkerContextWrapper::RunOrPostTaskOnCoreThread( ServiceWorkerContextWrapper::RunOrPostTaskOnCoreThread(
FROM_HERE, FROM_HERE,
base::BindOnce(&ServiceWorkerNavigationHandleCore::OnBeginWorkerCommit, base::BindOnce(&ServiceWorkerMainResourceHandleCore::OnBeginWorkerCommit,
base::Unretained(core_), cross_origin_embedder_policy)); base::Unretained(core_), cross_origin_embedder_policy));
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_H_ #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_MAIN_RESOURCE_HANDLE_H_
#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_H_ #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_MAIN_RESOURCE_HANDLE_H_
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
...@@ -14,47 +14,45 @@ ...@@ -14,47 +14,45 @@
namespace content { namespace content {
class ServiceWorkerContextWrapper; class ServiceWorkerContextWrapper;
class ServiceWorkerNavigationHandleCore; class ServiceWorkerMainResourceHandleCore;
// This class is used to manage the lifetime of ServiceWorkerProviderHosts // This class is used to manage the lifetime of ServiceWorkerProviderHosts
// created for main resource requests (navigations and web workers). This is a // created for main resource requests (navigations and web workers). This is a
// UI thread class, with a pendant class on the core thread, the // UI thread class, with a pendant class on the core thread, the
// ServiceWorkerNavigationHandleCore. // ServiceWorkerMainResourceHandleCore.
// //
// The lifetime of the ServiceWorkerNavigationHandle, the // The lifetime of the ServiceWorkerMainResourceHandle, the
// ServiceWorkerNavigationHandleCore and the ServiceWorkerProviderHost are the // ServiceWorkerMainResourceHandleCore and the ServiceWorkerProviderHost are the
// following: // following:
// 1) We create a ServiceWorkerNavigationHandle on the UI thread without // 1) We create a ServiceWorkerMainResourceHandle on the UI thread without
// populating the member service worker provider info. This also leads to the // populating the member service worker provider info. This also leads to the
// creation of a ServiceWorkerNavigationHandleCore. // creation of a ServiceWorkerMainResourceHandleCore.
// //
// 2) When the navigation request is sent to the core thread, we include a // 2) When the navigation request is sent to the core thread, we include a
// pointer to the ServiceWorkerNavigationHandleCore. // pointer to the ServiceWorkerMainResourceHandleCore.
// //
// 3) If we pre-create a ServiceWorkerProviderHost for this navigation, it // 3) If we pre-create a ServiceWorkerProviderHost for this navigation, it
// is added to ServiceWorkerContextCore and its provider info is passed to // is added to ServiceWorkerContextCore and its provider info is passed to
// ServiceWorkerNavigationHandle on the UI thread via // ServiceWorkerMainResourceHandle on the UI thread via
// ServiceWorkerNavigationHandleCore. See // ServiceWorkerMainResourceHandleCore. See
// ServiceWorkerNavigationHandleCore::OnCreatedProviderHost() and // ServiceWorkerMainResourceHandleCore::OnCreatedProviderHost() and
// ServiceWorkerNavigationHandle::OnCreatedProviderHost() for details. // ServiceWorkerMainResourceHandle::OnCreatedProviderHost() for details.
// //
// 4) When the navigation is ready to commit, the NavigationRequest will // 4) When the navigation is ready to commit, the NavigationRequest will
// call ServiceWorkerNavigationHandle::OnBeginNavigationCommit() to // call ServiceWorkerMainResourceHandle::OnBeginNavigationCommit() to
// - complete the initialization for the ServiceWorkerProviderHost. // - complete the initialization for the ServiceWorkerProviderHost.
// - take out the provider info to be sent as part of navigation commit IPC. // - take out the provider info to be sent as part of navigation commit IPC.
// //
// 5) When the navigation finishes, the ServiceWorkerNavigationHandle is // 5) When the navigation finishes, the ServiceWorkerMainResourceHandle is
// destroyed. The destructor of the ServiceWorkerNavigationHandle destroys // destroyed. The destructor of the ServiceWorkerMainResourceHandle destroys
// the provider info which in turn leads to the destruction of an unclaimed // the provider info which in turn leads to the destruction of an unclaimed
// ServiceWorkerProviderHost, and posts a task to destroy the // ServiceWorkerProviderHost, and posts a task to destroy the
// ServiceWorkerNavigationHandleCore on the core thread. // ServiceWorkerMainResourceHandleCore on the core thread.
// class CONTENT_EXPORT ServiceWorkerMainResourceHandle {
// TODO(falken): Rename ServiceWorkerMainResourceHandle.
class CONTENT_EXPORT ServiceWorkerNavigationHandle {
public: public:
explicit ServiceWorkerNavigationHandle( explicit ServiceWorkerMainResourceHandle(
ServiceWorkerContextWrapper* context_wrapper); ServiceWorkerContextWrapper* context_wrapper);
~ServiceWorkerNavigationHandle(); ~ServiceWorkerMainResourceHandle();
// Called after a ServiceWorkerProviderHost tied with |provider_info| // Called after a ServiceWorkerProviderHost tied with |provider_info|
// was pre-created for the navigation. // was pre-created for the navigation.
...@@ -87,25 +85,25 @@ class CONTENT_EXPORT ServiceWorkerNavigationHandle { ...@@ -87,25 +85,25 @@ class CONTENT_EXPORT ServiceWorkerNavigationHandle {
bool has_provider_info() const { return !!provider_info_; } bool has_provider_info() const { return !!provider_info_; }
ServiceWorkerNavigationHandleCore* core() { return core_; } ServiceWorkerMainResourceHandleCore* core() { return core_; }
const ServiceWorkerContextWrapper* context_wrapper() const { const ServiceWorkerContextWrapper* context_wrapper() const {
return context_wrapper_.get(); return context_wrapper_.get();
} }
base::WeakPtr<ServiceWorkerNavigationHandle> AsWeakPtr() { base::WeakPtr<ServiceWorkerMainResourceHandle> AsWeakPtr() {
return weak_factory_.GetWeakPtr(); return weak_factory_.GetWeakPtr();
} }
private: private:
blink::mojom::ServiceWorkerProviderInfoForClientPtr provider_info_; blink::mojom::ServiceWorkerProviderInfoForClientPtr provider_info_;
ServiceWorkerNavigationHandleCore* core_; ServiceWorkerMainResourceHandleCore* core_;
scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_;
base::WeakPtrFactory<ServiceWorkerNavigationHandle> weak_factory_{this}; base::WeakPtrFactory<ServiceWorkerMainResourceHandle> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNavigationHandle); DISALLOW_COPY_AND_ASSIGN(ServiceWorkerMainResourceHandle);
}; };
} // namespace content } // namespace content
#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_H_ #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_MAIN_RESOURCE_HANDLE_H_
...@@ -2,28 +2,28 @@ ...@@ -2,28 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/browser/service_worker/service_worker_navigation_handle_core.h" #include "content/browser/service_worker/service_worker_main_resource_handle_core.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/common/service_worker/service_worker_utils.h" #include "content/common/service_worker/service_worker_utils.h"
namespace content { namespace content {
ServiceWorkerNavigationHandleCore::ServiceWorkerNavigationHandleCore( ServiceWorkerMainResourceHandleCore::ServiceWorkerMainResourceHandleCore(
base::WeakPtr<ServiceWorkerNavigationHandle> ui_handle, base::WeakPtr<ServiceWorkerMainResourceHandle> ui_handle,
ServiceWorkerContextWrapper* context_wrapper) ServiceWorkerContextWrapper* context_wrapper)
: context_wrapper_(context_wrapper), ui_handle_(ui_handle) { : context_wrapper_(context_wrapper), ui_handle_(ui_handle) {
// The ServiceWorkerNavigationHandleCore is created on the UI thread but // The ServiceWorkerMainResourceHandleCore is created on the UI thread but
// should only be accessed from the core thread afterwards. // should only be accessed from the core thread afterwards.
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
} }
ServiceWorkerNavigationHandleCore::~ServiceWorkerNavigationHandleCore() { ServiceWorkerMainResourceHandleCore::~ServiceWorkerMainResourceHandleCore() {
DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId());
} }
void ServiceWorkerNavigationHandleCore::OnBeginNavigationCommit( void ServiceWorkerMainResourceHandleCore::OnBeginNavigationCommit(
int render_process_id, int render_process_id,
int render_frame_id, int render_frame_id,
network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy) { network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy) {
...@@ -34,7 +34,7 @@ void ServiceWorkerNavigationHandleCore::OnBeginNavigationCommit( ...@@ -34,7 +34,7 @@ void ServiceWorkerNavigationHandleCore::OnBeginNavigationCommit(
} }
} }
void ServiceWorkerNavigationHandleCore::OnBeginWorkerCommit( void ServiceWorkerMainResourceHandleCore::OnBeginWorkerCommit(
network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy) { network::mojom::CrossOriginEmbedderPolicy cross_origin_embedder_policy) {
DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId()); DCHECK_CURRENTLY_ON(ServiceWorkerContext::GetCoreThreadId());
if (container_host_) { if (container_host_) {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_CORE_H_ #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_MAIN_RESOURCE_HANDLE_CORE_H_
#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_CORE_H_ #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_MAIN_RESOURCE_HANDLE_CORE_H_
#include <memory> #include <memory>
#include <utility> #include <utility>
...@@ -19,24 +19,24 @@ ...@@ -19,24 +19,24 @@
namespace content { namespace content {
class ServiceWorkerContextWrapper; class ServiceWorkerContextWrapper;
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
// This class is created on the UI thread, but should only be accessed from the // This class is created on the UI thread, but should only be accessed from the
// service worker core thread afterwards. It is the core thread pendant of // service worker core thread afterwards. It is the core thread pendant of
// ServiceWorkerNavigationHandle. See the ServiceWorkerNavigationHandle header // ServiceWorkerMainResourceHandle. See the ServiceWorkerMainResourceHandle
// for more details about the lifetime of both classes. // header for more details about the lifetime of both classes.
// //
// TODO(crbug.com/824858): Merge this class into ServiceWorkerNavigationHandle // TODO(crbug.com/824858): Merge this class into ServiceWorkerMainResourceHandle
// when the core thread moves to the UI thread. // when the core thread moves to the UI thread.
class CONTENT_EXPORT ServiceWorkerNavigationHandleCore { class CONTENT_EXPORT ServiceWorkerMainResourceHandleCore {
public: public:
ServiceWorkerNavigationHandleCore( ServiceWorkerMainResourceHandleCore(
base::WeakPtr<ServiceWorkerNavigationHandle> ui_handle, base::WeakPtr<ServiceWorkerMainResourceHandle> ui_handle,
ServiceWorkerContextWrapper* context_wrapper); ServiceWorkerContextWrapper* context_wrapper);
~ServiceWorkerNavigationHandleCore(); ~ServiceWorkerMainResourceHandleCore();
// Called by corresponding methods in ServiceWorkerNavigationHandle. See // Called by corresponding methods in ServiceWorkerMainResourceHandle. See
// comments in the header of ServiceWorkerNavigationHandle for details. // comments in the header of ServiceWorkerMainResourceHandle for details.
void OnBeginNavigationCommit( void OnBeginNavigationCommit(
int render_process_id, int render_process_id,
int render_frame_id, int render_frame_id,
...@@ -66,20 +66,20 @@ class CONTENT_EXPORT ServiceWorkerNavigationHandleCore { ...@@ -66,20 +66,20 @@ class CONTENT_EXPORT ServiceWorkerNavigationHandleCore {
return interceptor_.get(); return interceptor_.get();
} }
base::WeakPtr<ServiceWorkerNavigationHandleCore> AsWeakPtr() { base::WeakPtr<ServiceWorkerMainResourceHandleCore> AsWeakPtr() {
return weak_factory_.GetWeakPtr(); return weak_factory_.GetWeakPtr();
} }
private: private:
scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_;
base::WeakPtr<ServiceWorkerNavigationHandle> ui_handle_; base::WeakPtr<ServiceWorkerMainResourceHandle> ui_handle_;
base::WeakPtr<ServiceWorkerContainerHost> container_host_; base::WeakPtr<ServiceWorkerContainerHost> container_host_;
std::unique_ptr<ServiceWorkerControlleeRequestHandler> interceptor_; std::unique_ptr<ServiceWorkerControlleeRequestHandler> interceptor_;
base::WeakPtrFactory<ServiceWorkerNavigationHandleCore> weak_factory_{this}; base::WeakPtrFactory<ServiceWorkerMainResourceHandleCore> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNavigationHandleCore); DISALLOW_COPY_AND_ASSIGN(ServiceWorkerMainResourceHandleCore);
}; };
} // namespace content } // namespace content
#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_CORE_H_ #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_MAIN_RESOURCE_HANDLE_CORE_H_
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_controllee_request_handler.h" #include "content/browser/service_worker/service_worker_controllee_request_handler.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_navigation_handle_core.h" #include "content/browser/service_worker/service_worker_main_resource_handle_core.h"
#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_provider_host.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h" #include "mojo/public/cpp/bindings/pending_associated_receiver.h"
...@@ -29,7 +29,7 @@ namespace { ...@@ -29,7 +29,7 @@ namespace {
// Core thread helpers // Core thread helpers
void LoaderCallbackWrapperOnCoreThread( void LoaderCallbackWrapperOnCoreThread(
ServiceWorkerNavigationHandleCore* handle_core, ServiceWorkerMainResourceHandleCore* handle_core,
base::WeakPtr<ServiceWorkerNavigationLoaderInterceptor> interceptor_on_ui, base::WeakPtr<ServiceWorkerNavigationLoaderInterceptor> interceptor_on_ui,
NavigationLoaderInterceptor::LoaderCallback loader_callback, NavigationLoaderInterceptor::LoaderCallback loader_callback,
SingleRequestURLLoaderFactory::RequestHandler handler) { SingleRequestURLLoaderFactory::RequestHandler handler) {
...@@ -77,7 +77,7 @@ void InvokeRequestHandlerOnCoreThread( ...@@ -77,7 +77,7 @@ void InvokeRequestHandlerOnCoreThread(
// |interceptor_on_ui->LoaderCallbackWrapper()| on the UI thread. // |interceptor_on_ui->LoaderCallbackWrapper()| on the UI thread.
void MaybeCreateLoaderOnCoreThread( void MaybeCreateLoaderOnCoreThread(
base::WeakPtr<ServiceWorkerNavigationLoaderInterceptor> interceptor_on_ui, base::WeakPtr<ServiceWorkerNavigationLoaderInterceptor> interceptor_on_ui,
ServiceWorkerNavigationHandleCore* handle_core, ServiceWorkerMainResourceHandleCore* handle_core,
const ServiceWorkerNavigationLoaderInterceptorParams& params, const ServiceWorkerNavigationLoaderInterceptorParams& params,
mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost> mojo::PendingAssociatedReceiver<blink::mojom::ServiceWorkerContainerHost>
host_receiver, host_receiver,
...@@ -106,7 +106,7 @@ void MaybeCreateLoaderOnCoreThread( ...@@ -106,7 +106,7 @@ void MaybeCreateLoaderOnCoreThread(
if (!handle_core->container_host()) { if (!handle_core->container_host()) {
// This is the initial request before redirects, so make the container host. // This is the initial request before redirects, so make the container host.
// Its lifetime is tied to the |provider_info| in the // Its lifetime is tied to the |provider_info| in the
// ServiceWorkerNavigationHandle on the UI thread and which will be passed // ServiceWorkerMainResourceHandle on the UI thread and which will be passed
// to the renderer when the navigation commits. // to the renderer when the navigation commits.
DCHECK(host_receiver); DCHECK(host_receiver);
DCHECK(client_remote); DCHECK(client_remote);
...@@ -177,7 +177,7 @@ void MaybeCreateLoaderOnCoreThread( ...@@ -177,7 +177,7 @@ void MaybeCreateLoaderOnCoreThread(
ServiceWorkerNavigationLoaderInterceptor:: ServiceWorkerNavigationLoaderInterceptor::
ServiceWorkerNavigationLoaderInterceptor( ServiceWorkerNavigationLoaderInterceptor(
const ServiceWorkerNavigationLoaderInterceptorParams& params, const ServiceWorkerNavigationLoaderInterceptorParams& params,
base::WeakPtr<ServiceWorkerNavigationHandle> handle) base::WeakPtr<ServiceWorkerMainResourceHandle> handle)
: handle_(std::move(handle)), params_(params) { : handle_(std::move(handle)), params_(params) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(handle_); DCHECK(handle_);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
namespace content { namespace content {
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
struct ServiceWorkerNavigationLoaderInterceptorParams { struct ServiceWorkerNavigationLoaderInterceptorParams {
// For all clients: // For all clients:
...@@ -50,7 +50,7 @@ class ServiceWorkerNavigationLoaderInterceptor final ...@@ -50,7 +50,7 @@ class ServiceWorkerNavigationLoaderInterceptor final
public: public:
ServiceWorkerNavigationLoaderInterceptor( ServiceWorkerNavigationLoaderInterceptor(
const ServiceWorkerNavigationLoaderInterceptorParams& params, const ServiceWorkerNavigationLoaderInterceptorParams& params,
base::WeakPtr<ServiceWorkerNavigationHandle> handle); base::WeakPtr<ServiceWorkerMainResourceHandle> handle);
~ServiceWorkerNavigationLoaderInterceptor() override; ~ServiceWorkerNavigationLoaderInterceptor() override;
// NavigationLoaderInterceptor overrides: // NavigationLoaderInterceptor overrides:
...@@ -92,7 +92,7 @@ class ServiceWorkerNavigationLoaderInterceptor final ...@@ -92,7 +92,7 @@ class ServiceWorkerNavigationLoaderInterceptor final
// DedicatedWorkerHost or SharedWorkerHost which may be destroyed before // DedicatedWorkerHost or SharedWorkerHost which may be destroyed before
// WorkerScriptLoader which owns |this|. // WorkerScriptLoader which owns |this|.
// TODO(falken): Arrange things so |handle_| outlives |this| for workers too. // TODO(falken): Arrange things so |handle_| outlives |this| for workers too.
const base::WeakPtr<ServiceWorkerNavigationHandle> handle_; const base::WeakPtr<ServiceWorkerMainResourceHandle> handle_;
const ServiceWorkerNavigationLoaderInterceptorParams params_; const ServiceWorkerNavigationLoaderInterceptorParams params_;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "content/browser/frame_host/navigation_request_info.h" #include "content/browser/frame_host/navigation_request_info.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_navigation_loader_interceptor.h" #include "content/browser/service_worker/service_worker_navigation_loader_interceptor.h"
#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_provider_host.h"
#include "content/public/common/origin_util.h" #include "content/public/common/origin_util.h"
...@@ -35,7 +35,7 @@ bool SchemeMaySupportRedirectingToHTTPS(const GURL& url) { ...@@ -35,7 +35,7 @@ bool SchemeMaySupportRedirectingToHTTPS(const GURL& url) {
std::unique_ptr<NavigationLoaderInterceptor> std::unique_ptr<NavigationLoaderInterceptor>
ServiceWorkerRequestHandler::CreateForNavigation( ServiceWorkerRequestHandler::CreateForNavigation(
const GURL& url, const GURL& url,
base::WeakPtr<ServiceWorkerNavigationHandle> navigation_handle, base::WeakPtr<ServiceWorkerMainResourceHandle> navigation_handle,
const NavigationRequestInfo& request_info) { const NavigationRequestInfo& request_info) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
...@@ -63,7 +63,7 @@ std::unique_ptr<NavigationLoaderInterceptor> ...@@ -63,7 +63,7 @@ std::unique_ptr<NavigationLoaderInterceptor>
ServiceWorkerRequestHandler::CreateForWorker( ServiceWorkerRequestHandler::CreateForWorker(
const network::ResourceRequest& resource_request, const network::ResourceRequest& resource_request,
int process_id, int process_id,
base::WeakPtr<ServiceWorkerNavigationHandle> navigation_handle) { base::WeakPtr<ServiceWorkerMainResourceHandle> navigation_handle) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto resource_type = auto resource_type =
......
...@@ -19,7 +19,7 @@ struct ResourceRequest; ...@@ -19,7 +19,7 @@ struct ResourceRequest;
namespace content { namespace content {
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
struct NavigationRequestInfo; struct NavigationRequestInfo;
// Contains factory methods for creating the NavigationLoaderInterceptors for // Contains factory methods for creating the NavigationLoaderInterceptors for
...@@ -32,7 +32,7 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler { ...@@ -32,7 +32,7 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler {
// navigation cannot use service workers. Called on the UI thread. // navigation cannot use service workers. Called on the UI thread.
static std::unique_ptr<NavigationLoaderInterceptor> CreateForNavigation( static std::unique_ptr<NavigationLoaderInterceptor> CreateForNavigation(
const GURL& url, const GURL& url,
base::WeakPtr<ServiceWorkerNavigationHandle> navigation_handle, base::WeakPtr<ServiceWorkerMainResourceHandle> navigation_handle,
const NavigationRequestInfo& request_info); const NavigationRequestInfo& request_info);
// Returns a loader interceptor for a dedicated worker or shared worker. May // Returns a loader interceptor for a dedicated worker or shared worker. May
...@@ -41,7 +41,7 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler { ...@@ -41,7 +41,7 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler {
static std::unique_ptr<NavigationLoaderInterceptor> CreateForWorker( static std::unique_ptr<NavigationLoaderInterceptor> CreateForWorker(
const network::ResourceRequest& resource_request, const network::ResourceRequest& resource_request,
int process_id, int process_id,
base::WeakPtr<ServiceWorkerNavigationHandle> navigation_handle); base::WeakPtr<ServiceWorkerMainResourceHandle> navigation_handle);
private: private:
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "content/browser/service_worker/embedded_worker_test_helper.h" #include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_provider_host.h"
#include "content/browser/service_worker/service_worker_test_utils.h" #include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/common/navigation_params.mojom.h" #include "content/common/navigation_params.mojom.h"
...@@ -55,7 +55,7 @@ class ServiceWorkerRequestHandlerTest : public testing::Test { ...@@ -55,7 +55,7 @@ class ServiceWorkerRequestHandlerTest : public testing::Test {
void InitializeHandlerForNavigationSimpleTest(const std::string& url, void InitializeHandlerForNavigationSimpleTest(const std::string& url,
bool expected_handler_created) { bool expected_handler_created) {
auto navigation_handle = auto navigation_handle =
std::make_unique<ServiceWorkerNavigationHandle>(context_wrapper()); std::make_unique<ServiceWorkerMainResourceHandle>(context_wrapper());
GURL gurl(url); GURL gurl(url);
auto begin_params = mojom::BeginNavigationParams::New(); auto begin_params = mojom::BeginNavigationParams::New();
begin_params->request_context_type = begin_params->request_context_type =
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "content/browser/frame_host/frame_tree.h" #include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/interface_provider_filtering.h" #include "content/browser/interface_provider_filtering.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_object_host.h" #include "content/browser/service_worker/service_worker_object_host.h"
#include "content/browser/storage_partition_impl.h" #include "content/browser/storage_partition_impl.h"
#include "content/browser/url_loader_factory_params_helper.h" #include "content/browser/url_loader_factory_params_helper.h"
...@@ -180,7 +180,7 @@ void DedicatedWorkerHost::StartScriptLoad( ...@@ -180,7 +180,7 @@ void DedicatedWorkerHost::StartScriptLoad(
// factories be used for subresource loading on the worker. // factories be used for subresource loading on the worker.
file_url_support_ = request_initiator_origin.scheme() == url::kFileScheme; file_url_support_ = request_initiator_origin.scheme() == url::kFileScheme;
service_worker_handle_ = std::make_unique<ServiceWorkerNavigationHandle>( service_worker_handle_ = std::make_unique<ServiceWorkerMainResourceHandle>(
storage_partition_impl->GetServiceWorkerContext()); storage_partition_impl->GetServiceWorkerContext());
WorkerScriptFetchInitiator::Start( WorkerScriptFetchInitiator::Start(
......
...@@ -34,7 +34,7 @@ class Origin; ...@@ -34,7 +34,7 @@ class Origin;
namespace content { namespace content {
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
class ServiceWorkerObjectHost; class ServiceWorkerObjectHost;
class StoragePartitionImpl; class StoragePartitionImpl;
...@@ -170,7 +170,7 @@ class DedicatedWorkerHost final : public blink::mojom::DedicatedWorkerHost { ...@@ -170,7 +170,7 @@ class DedicatedWorkerHost final : public blink::mojom::DedicatedWorkerHost {
// starting or running. // starting or running.
mojo::Remote<blink::mojom::DedicatedWorkerHostFactoryClient> client_; mojo::Remote<blink::mojom::DedicatedWorkerHostFactoryClient> client_;
std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; std::unique_ptr<ServiceWorkerMainResourceHandle> service_worker_handle_;
BrowserInterfaceBrokerImpl<DedicatedWorkerHost, const url::Origin&> broker_{ BrowserInterfaceBrokerImpl<DedicatedWorkerHost, const url::Origin&> broker_{
this}; this};
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "content/browser/devtools/shared_worker_devtools_manager.h" #include "content/browser/devtools/shared_worker_devtools_manager.h"
#include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/interface_provider_filtering.h" #include "content/browser/interface_provider_filtering.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_object_host.h" #include "content/browser/service_worker/service_worker_object_host.h"
#include "content/browser/storage_partition_impl.h" #include "content/browser/storage_partition_impl.h"
#include "content/browser/url_loader_factory_params_helper.h" #include "content/browser/url_loader_factory_params_helper.h"
...@@ -448,7 +448,7 @@ void SharedWorkerHost::SetAppCacheHandle( ...@@ -448,7 +448,7 @@ void SharedWorkerHost::SetAppCacheHandle(
} }
void SharedWorkerHost::SetServiceWorkerHandle( void SharedWorkerHost::SetServiceWorkerHandle(
std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle) { std::unique_ptr<ServiceWorkerMainResourceHandle> service_worker_handle) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
service_worker_handle_ = std::move(service_worker_handle); service_worker_handle_ = std::move(service_worker_handle);
} }
......
...@@ -49,7 +49,7 @@ class PendingURLLoaderFactoryBundle; ...@@ -49,7 +49,7 @@ class PendingURLLoaderFactoryBundle;
namespace content { namespace content {
class AppCacheNavigationHandle; class AppCacheNavigationHandle;
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
class ServiceWorkerObjectHost; class ServiceWorkerObjectHost;
class SharedWorkerContentSettingsProxyImpl; class SharedWorkerContentSettingsProxyImpl;
class SharedWorkerServiceImpl; class SharedWorkerServiceImpl;
...@@ -114,7 +114,7 @@ class CONTENT_EXPORT SharedWorkerHost : public blink::mojom::SharedWorkerHost, ...@@ -114,7 +114,7 @@ class CONTENT_EXPORT SharedWorkerHost : public blink::mojom::SharedWorkerHost,
void SetAppCacheHandle( void SetAppCacheHandle(
std::unique_ptr<AppCacheNavigationHandle> appcache_handle); std::unique_ptr<AppCacheNavigationHandle> appcache_handle);
void SetServiceWorkerHandle( void SetServiceWorkerHandle(
std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle); std::unique_ptr<ServiceWorkerMainResourceHandle> service_worker_handle);
// Removes all clients whose RenderFrameHost has been destroyed before the // Removes all clients whose RenderFrameHost has been destroyed before the
// shared worker was started. // shared worker was started.
...@@ -222,7 +222,7 @@ class CONTENT_EXPORT SharedWorkerHost : public blink::mojom::SharedWorkerHost, ...@@ -222,7 +222,7 @@ class CONTENT_EXPORT SharedWorkerHost : public blink::mojom::SharedWorkerHost,
// renderer after main script loading finishes. // renderer after main script loading finishes.
std::unique_ptr<AppCacheNavigationHandle> appcache_handle_; std::unique_ptr<AppCacheNavigationHandle> appcache_handle_;
std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; std::unique_ptr<ServiceWorkerMainResourceHandle> service_worker_handle_;
// Indicates if Start() was invoked on this instance. // Indicates if Start() was invoked on this instance.
bool started_ = false; bool started_ = false;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "content/browser/appcache/chrome_appcache_service.h" #include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/navigation_subresource_loader_params.h" #include "content/browser/navigation_subresource_loader_params.h"
#include "content/browser/service_worker/embedded_worker_test_helper.h" #include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/worker_host/mock_shared_worker.h" #include "content/browser/worker_host/mock_shared_worker.h"
#include "content/browser/worker_host/shared_worker_connector_impl.h" #include "content/browser/worker_host/shared_worker_connector_impl.h"
#include "content/browser/worker_host/shared_worker_service_impl.h" #include "content/browser/worker_host/shared_worker_service_impl.h"
...@@ -99,7 +99,7 @@ class SharedWorkerHostTest : public testing::Test { ...@@ -99,7 +99,7 @@ class SharedWorkerHostTest : public testing::Test {
// Set up for service worker. // Set up for service worker.
auto service_worker_handle = auto service_worker_handle =
std::make_unique<ServiceWorkerNavigationHandle>( std::make_unique<ServiceWorkerMainResourceHandle>(
helper_->context_wrapper()); helper_->context_wrapper());
mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer> mojo::PendingAssociatedRemote<blink::mojom::ServiceWorkerContainer>
client_remote; client_remote;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "content/browser/appcache/appcache_navigation_handle.h" #include "content/browser/appcache/appcache_navigation_handle.h"
#include "content/browser/loader/file_url_loader_factory.h" #include "content/browser/loader/file_url_loader_factory.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/storage_partition_impl.h" #include "content/browser/storage_partition_impl.h"
#include "content/browser/url_loader_factory_getter.h" #include "content/browser/url_loader_factory_getter.h"
#include "content/browser/web_contents/web_contents_impl.h" #include "content/browser/web_contents/web_contents_impl.h"
...@@ -273,8 +273,9 @@ SharedWorkerHost* SharedWorkerServiceImpl::CreateWorker( ...@@ -273,8 +273,9 @@ SharedWorkerHost* SharedWorkerServiceImpl::CreateWorker(
appcache_handle->host()->GetWeakPtr(); appcache_handle->host()->GetWeakPtr();
host->SetAppCacheHandle(std::move(appcache_handle)); host->SetAppCacheHandle(std::move(appcache_handle));
auto service_worker_handle = std::make_unique<ServiceWorkerNavigationHandle>( auto service_worker_handle =
storage_partition_->GetServiceWorkerContext()); std::make_unique<ServiceWorkerMainResourceHandle>(
storage_partition_->GetServiceWorkerContext());
auto* service_worker_handle_raw = service_worker_handle.get(); auto* service_worker_handle_raw = service_worker_handle.get();
host->SetServiceWorkerHandle(std::move(service_worker_handle)); host->SetServiceWorkerHandle(std::move(service_worker_handle));
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include "content/browser/loader/file_url_loader_factory.h" #include "content/browser/loader/file_url_loader_factory.h"
#include "content/browser/navigation_subresource_loader_params.h" #include "content/browser/navigation_subresource_loader_params.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_navigation_handle_core.h" #include "content/browser/service_worker/service_worker_main_resource_handle_core.h"
#include "content/browser/storage_partition_impl.h" #include "content/browser/storage_partition_impl.h"
#include "content/browser/url_loader_factory_params_helper.h" #include "content/browser/url_loader_factory_params_helper.h"
#include "content/browser/web_contents/web_contents_impl.h" #include "content/browser/web_contents/web_contents_impl.h"
...@@ -66,7 +66,7 @@ void WorkerScriptFetchInitiator::Start( ...@@ -66,7 +66,7 @@ void WorkerScriptFetchInitiator::Start(
outside_fetch_client_settings_object, outside_fetch_client_settings_object,
ResourceType resource_type, ResourceType resource_type,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
base::WeakPtr<AppCacheHost> appcache_host, base::WeakPtr<AppCacheHost> appcache_host,
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_override, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_override,
...@@ -282,7 +282,7 @@ void WorkerScriptFetchInitiator::CreateScriptLoader( ...@@ -282,7 +282,7 @@ void WorkerScriptFetchInitiator::CreateScriptLoader(
std::unique_ptr<blink::PendingURLLoaderFactoryBundle> std::unique_ptr<blink::PendingURLLoaderFactoryBundle>
subresource_loader_factories, subresource_loader_factories,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
base::WeakPtr<AppCacheHost> appcache_host, base::WeakPtr<AppCacheHost> appcache_host,
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory,
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_override, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_override,
......
...@@ -36,7 +36,7 @@ class AppCacheHost; ...@@ -36,7 +36,7 @@ class AppCacheHost;
class BrowserContext; class BrowserContext;
class RenderFrameHost; class RenderFrameHost;
class ServiceWorkerContextWrapper; class ServiceWorkerContextWrapper;
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
class ServiceWorkerObjectHost; class ServiceWorkerObjectHost;
class StoragePartitionImpl; class StoragePartitionImpl;
struct SubresourceLoaderParams; struct SubresourceLoaderParams;
...@@ -68,7 +68,7 @@ class WorkerScriptFetchInitiator { ...@@ -68,7 +68,7 @@ class WorkerScriptFetchInitiator {
outside_fetch_client_settings_object, outside_fetch_client_settings_object,
ResourceType resource_type, ResourceType resource_type,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
base::WeakPtr<AppCacheHost> appcache_host, base::WeakPtr<AppCacheHost> appcache_host,
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory,
scoped_refptr<network::SharedURLLoaderFactory> scoped_refptr<network::SharedURLLoaderFactory>
...@@ -106,7 +106,7 @@ class WorkerScriptFetchInitiator { ...@@ -106,7 +106,7 @@ class WorkerScriptFetchInitiator {
std::unique_ptr<blink::PendingURLLoaderFactoryBundle> std::unique_ptr<blink::PendingURLLoaderFactoryBundle>
subresource_loader_factories, subresource_loader_factories,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
base::WeakPtr<AppCacheHost> appcache_host, base::WeakPtr<AppCacheHost> appcache_host,
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory,
scoped_refptr<network::SharedURLLoaderFactory> scoped_refptr<network::SharedURLLoaderFactory>
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "content/browser/appcache/appcache_request_handler.h" #include "content/browser/appcache/appcache_request_handler.h"
#include "content/browser/loader/navigation_loader_interceptor.h" #include "content/browser/loader/navigation_loader_interceptor.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_navigation_handle_core.h" #include "content/browser/service_worker/service_worker_main_resource_handle_core.h"
#include "content/browser/service_worker/service_worker_request_handler.h" #include "content/browser/service_worker/service_worker_request_handler.h"
#include "content/browser/worker_host/worker_script_fetch_initiator.h" #include "content/browser/worker_host/worker_script_fetch_initiator.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
...@@ -26,7 +26,7 @@ WorkerScriptLoader::WorkerScriptLoader( ...@@ -26,7 +26,7 @@ WorkerScriptLoader::WorkerScriptLoader(
uint32_t options, uint32_t options,
const network::ResourceRequest& resource_request, const network::ResourceRequest& resource_request,
mojo::PendingRemote<network::mojom::URLLoaderClient> client, mojo::PendingRemote<network::mojom::URLLoaderClient> client,
base::WeakPtr<ServiceWorkerNavigationHandle> service_worker_handle, base::WeakPtr<ServiceWorkerMainResourceHandle> service_worker_handle,
base::WeakPtr<AppCacheHost> appcache_host, base::WeakPtr<AppCacheHost> appcache_host,
const BrowserContextGetter& browser_context_getter, const BrowserContextGetter& browser_context_getter,
scoped_refptr<network::SharedURLLoaderFactory> default_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> default_loader_factory,
......
...@@ -36,7 +36,7 @@ class AppCacheHost; ...@@ -36,7 +36,7 @@ class AppCacheHost;
class BrowserContext; class BrowserContext;
class NavigationLoaderInterceptor; class NavigationLoaderInterceptor;
class ResourceContext; class ResourceContext;
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
// The URLLoader for loading a shared worker script. Only used for the main // The URLLoader for loading a shared worker script. Only used for the main
// script request. // script request.
...@@ -72,7 +72,7 @@ class WorkerScriptLoader : public network::mojom::URLLoader, ...@@ -72,7 +72,7 @@ class WorkerScriptLoader : public network::mojom::URLLoader,
uint32_t options, uint32_t options,
const network::ResourceRequest& resource_request, const network::ResourceRequest& resource_request,
mojo::PendingRemote<network::mojom::URLLoaderClient> client, mojo::PendingRemote<network::mojom::URLLoaderClient> client,
base::WeakPtr<ServiceWorkerNavigationHandle> service_worker_handle, base::WeakPtr<ServiceWorkerMainResourceHandle> service_worker_handle,
base::WeakPtr<AppCacheHost> appcache_host, base::WeakPtr<AppCacheHost> appcache_host,
const BrowserContextGetter& browser_context_getter, const BrowserContextGetter& browser_context_getter,
scoped_refptr<network::SharedURLLoaderFactory> default_loader_factory, scoped_refptr<network::SharedURLLoaderFactory> default_loader_factory,
...@@ -145,7 +145,7 @@ class WorkerScriptLoader : public network::mojom::URLLoader, ...@@ -145,7 +145,7 @@ class WorkerScriptLoader : public network::mojom::URLLoader,
const uint32_t options_; const uint32_t options_;
network::ResourceRequest resource_request_; network::ResourceRequest resource_request_;
mojo::Remote<network::mojom::URLLoaderClient> client_; mojo::Remote<network::mojom::URLLoaderClient> client_;
base::WeakPtr<ServiceWorkerNavigationHandle> service_worker_handle_; base::WeakPtr<ServiceWorkerMainResourceHandle> service_worker_handle_;
BrowserContextGetter browser_context_getter_; BrowserContextGetter browser_context_getter_;
scoped_refptr<network::SharedURLLoaderFactory> default_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> default_loader_factory_;
net::MutableNetworkTrafficAnnotationTag traffic_annotation_; net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include <memory> #include <memory>
#include "base/feature_list.h" #include "base/feature_list.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_navigation_handle_core.h" #include "content/browser/service_worker/service_worker_main_resource_handle_core.h"
#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_provider_host.h"
#include "content/browser/service_worker/service_worker_version.h" #include "content/browser/service_worker/service_worker_version.h"
#include "content/browser/worker_host/worker_script_fetch_initiator.h" #include "content/browser/worker_host/worker_script_fetch_initiator.h"
...@@ -22,7 +22,7 @@ namespace content { ...@@ -22,7 +22,7 @@ namespace content {
WorkerScriptLoaderFactory::WorkerScriptLoaderFactory( WorkerScriptLoaderFactory::WorkerScriptLoaderFactory(
int process_id, int process_id,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
base::WeakPtr<AppCacheHost> appcache_host, base::WeakPtr<AppCacheHost> appcache_host,
const BrowserContextGetter& browser_context_getter, const BrowserContextGetter& browser_context_getter,
scoped_refptr<network::SharedURLLoaderFactory> loader_factory) scoped_refptr<network::SharedURLLoaderFactory> loader_factory)
......
...@@ -20,7 +20,7 @@ namespace content { ...@@ -20,7 +20,7 @@ namespace content {
class AppCacheHost; class AppCacheHost;
class BrowserContext; class BrowserContext;
class ServiceWorkerNavigationHandle; class ServiceWorkerMainResourceHandle;
class ResourceContext; class ResourceContext;
class WorkerScriptLoader; class WorkerScriptLoader;
...@@ -48,7 +48,7 @@ class CONTENT_EXPORT WorkerScriptLoaderFactory ...@@ -48,7 +48,7 @@ class CONTENT_EXPORT WorkerScriptLoaderFactory
// factories used for non-http(s) URLs, e.g., a chrome-extension:// URL. // factories used for non-http(s) URLs, e.g., a chrome-extension:// URL.
WorkerScriptLoaderFactory( WorkerScriptLoaderFactory(
int process_id, int process_id,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
base::WeakPtr<AppCacheHost> appcache_host, base::WeakPtr<AppCacheHost> appcache_host,
const BrowserContextGetter& browser_context_getter, const BrowserContextGetter& browser_context_getter,
scoped_refptr<network::SharedURLLoaderFactory> loader_factory); scoped_refptr<network::SharedURLLoaderFactory> loader_factory);
...@@ -71,7 +71,7 @@ class CONTENT_EXPORT WorkerScriptLoaderFactory ...@@ -71,7 +71,7 @@ class CONTENT_EXPORT WorkerScriptLoaderFactory
private: private:
const int process_id_; const int process_id_;
base::WeakPtr<ServiceWorkerNavigationHandle> service_worker_handle_; base::WeakPtr<ServiceWorkerMainResourceHandle> service_worker_handle_;
base::WeakPtr<AppCacheHost> appcache_host_; base::WeakPtr<AppCacheHost> appcache_host_;
BrowserContextGetter browser_context_getter_; BrowserContextGetter browser_context_getter_;
scoped_refptr<network::SharedURLLoaderFactory> loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> loader_factory_;
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include "content/browser/service_worker/service_worker_container_host.h" #include "content/browser/service_worker/service_worker_container_host.h"
#include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h" #include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_navigation_handle_core.h" #include "content/browser/service_worker/service_worker_main_resource_handle_core.h"
#include "content/public/test/browser_task_environment.h" #include "content/public/test/browser_task_environment.h"
#include "content/test/fake_network_url_loader_factory.h" #include "content/test/fake_network_url_loader_factory.h"
#include "net/base/network_isolation_key.h" #include "net/base/network_isolation_key.h"
...@@ -56,7 +56,7 @@ class WorkerScriptLoaderFactoryTest : public testing::Test { ...@@ -56,7 +56,7 @@ class WorkerScriptLoaderFactoryTest : public testing::Test {
network::SharedURLLoaderFactory::Create(std::move(info)); network::SharedURLLoaderFactory::Create(std::move(info));
// Set up a service worker host for the shared worker. // Set up a service worker host for the shared worker.
service_worker_handle_ = std::make_unique<ServiceWorkerNavigationHandle>( service_worker_handle_ = std::make_unique<ServiceWorkerMainResourceHandle>(
helper_->context_wrapper()); helper_->context_wrapper());
} }
...@@ -86,7 +86,7 @@ class WorkerScriptLoaderFactoryTest : public testing::Test { ...@@ -86,7 +86,7 @@ class WorkerScriptLoaderFactoryTest : public testing::Test {
std::unique_ptr<EmbeddedWorkerTestHelper> helper_; std::unique_ptr<EmbeddedWorkerTestHelper> helper_;
std::unique_ptr<FakeNetworkURLLoaderFactory> network_loader_factory_instance_; std::unique_ptr<FakeNetworkURLLoaderFactory> network_loader_factory_instance_;
scoped_refptr<network::SharedURLLoaderFactory> network_loader_factory_; scoped_refptr<network::SharedURLLoaderFactory> network_loader_factory_;
std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; std::unique_ptr<ServiceWorkerMainResourceHandle> service_worker_handle_;
WorkerScriptLoaderFactory::BrowserContextGetter browser_context_getter_; WorkerScriptLoaderFactory::BrowserContextGetter browser_context_getter_;
}; };
......
...@@ -25,7 +25,7 @@ TestNavigationURLLoaderFactory::CreateLoader( ...@@ -25,7 +25,7 @@ TestNavigationURLLoaderFactory::CreateLoader(
StoragePartition* storage_partition, StoragePartition* storage_partition,
std::unique_ptr<NavigationRequestInfo> request_info, std::unique_ptr<NavigationRequestInfo> request_info,
std::unique_ptr<NavigationUIData> navigation_ui_data, std::unique_ptr<NavigationUIData> navigation_ui_data,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
NavigationURLLoaderDelegate* delegate, NavigationURLLoaderDelegate* delegate,
bool is_served_from_back_forward_cache) { bool is_served_from_back_forward_cache) {
return std::unique_ptr<NavigationURLLoader>(new TestNavigationURLLoader( return std::unique_ptr<NavigationURLLoader>(new TestNavigationURLLoader(
......
...@@ -27,7 +27,7 @@ class TestNavigationURLLoaderFactory : public NavigationURLLoaderFactory { ...@@ -27,7 +27,7 @@ class TestNavigationURLLoaderFactory : public NavigationURLLoaderFactory {
StoragePartition* storage_partition, StoragePartition* storage_partition,
std::unique_ptr<NavigationRequestInfo> request_info, std::unique_ptr<NavigationRequestInfo> request_info,
std::unique_ptr<NavigationUIData> navigation_ui_data, std::unique_ptr<NavigationUIData> navigation_ui_data,
ServiceWorkerNavigationHandle* service_worker_handle, ServiceWorkerMainResourceHandle* service_worker_handle,
NavigationURLLoaderDelegate* delegate, NavigationURLLoaderDelegate* delegate,
bool is_served_from_back_forward_cache) override; bool is_served_from_back_forward_cache) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment