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

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

Issue 2045383002: PlzNavigate: detect when a ServiceWorker is present (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Calling FindReadyRegistartionForDocument Created 4 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_request_handler.cc
diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc
index 7157aa540a8a26358c59dd8db4b491a9482a9244..ef9277cf269ea793dd3e002355afaa6a81256f5f 100644
--- a/content/browser/service_worker/service_worker_request_handler.cc
+++ b/content/browser/service_worker/service_worker_request_handler.cc
@@ -10,7 +10,6 @@
#include "base/macros.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_navigation_handle_core.h"
#include "content/browser/service_worker/service_worker_provider_host.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/service_worker/service_worker_url_request_job.h"
@@ -92,54 +91,6 @@ void FinalizeHandlerInitialization(
} // namespace
-// PlzNavigate
-void ServiceWorkerRequestHandler::InitializeForNavigation(
- net::URLRequest* request,
- ServiceWorkerNavigationHandleCore* navigation_handle_core,
- storage::BlobStorageContext* blob_storage_context,
- bool skip_service_worker,
- ResourceType resource_type,
- RequestContextType request_context_type,
- RequestContextFrameType frame_type,
- scoped_refptr<ResourceRequestBodyImpl> body) {
- CHECK(IsBrowserSideNavigationEnabled());
-
- // Only create a handler when there is a ServiceWorkerNavigationHandlerCore
- // to take ownership of a pre-created SeviceWorkerProviderHost.
- if (!navigation_handle_core)
- return;
-
- // Create the handler even for insecure HTTP since it's used in the
- // case of redirect to HTTPS.
- if (!request->url().SchemeIsHTTPOrHTTPS() &&
- !OriginCanAccessServiceWorkers(request->url())) {
- return;
- }
-
- if (!navigation_handle_core->context_wrapper() ||
- !navigation_handle_core->context_wrapper()->context()) {
- return;
- }
-
- // Initialize the SWProviderHost.
- std::unique_ptr<ServiceWorkerProviderHost> provider_host =
- ServiceWorkerProviderHost::PreCreateNavigationHost(
- navigation_handle_core->context_wrapper()->context()->AsWeakPtr());
-
- FinalizeHandlerInitialization(
- request, provider_host.get(), blob_storage_context, skip_service_worker,
- FETCH_REQUEST_MODE_SAME_ORIGIN, FETCH_CREDENTIALS_MODE_INCLUDE,
- FetchRedirectMode::MANUAL_MODE, resource_type, request_context_type,
- frame_type, body);
-
- // Transfer ownership to the ServiceWorkerNavigationHandleCore.
- // In the case of a successful navigation, the SWProviderHost will be
- // transferred to its "final" destination in the OnProviderCreated handler. If
- // the navigation fails, it will be destroyed along with the
- // ServiceWorkerNavigationHandleCore.
- navigation_handle_core->DidPreCreateProviderHost(std::move(provider_host));
-}
-
void ServiceWorkerRequestHandler::InitializeHandler(
net::URLRequest* request,
ServiceWorkerContextWrapper* context_wrapper,

Powered by Google App Engine
This is Rietveld 408576698