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

Side by Side Diff: content/browser/service_worker/service_worker_provider_host.cc

Issue 2410333006: Implement ServiceWorkerFetchDispatcher::MaybeStartNavigationPreload(). (Closed)
Patch Set: add comment about switch Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_provider_host.h" 5 #include "content/browser/service_worker/service_worker_provider_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 RequestContextFrameType frame_type, 334 RequestContextFrameType frame_type,
335 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, 335 base::WeakPtr<storage::BlobStorageContext> blob_storage_context,
336 scoped_refptr<ResourceRequestBodyImpl> body) { 336 scoped_refptr<ResourceRequestBodyImpl> body) {
337 if (IsHostToRunningServiceWorker()) { 337 if (IsHostToRunningServiceWorker()) {
338 return std::unique_ptr<ServiceWorkerRequestHandler>( 338 return std::unique_ptr<ServiceWorkerRequestHandler>(
339 new ServiceWorkerContextRequestHandler( 339 new ServiceWorkerContextRequestHandler(
340 context_, AsWeakPtr(), blob_storage_context, resource_type)); 340 context_, AsWeakPtr(), blob_storage_context, resource_type));
341 } 341 }
342 if (ServiceWorkerUtils::IsMainResourceType(resource_type) || 342 if (ServiceWorkerUtils::IsMainResourceType(resource_type) ||
343 controlling_version()) { 343 controlling_version()) {
344 // |dispatcher_host_| may be null in some unittests.
344 return std::unique_ptr<ServiceWorkerRequestHandler>( 345 return std::unique_ptr<ServiceWorkerRequestHandler>(
345 new ServiceWorkerControlleeRequestHandler( 346 new ServiceWorkerControlleeRequestHandler(
346 context_, AsWeakPtr(), blob_storage_context, request_mode, 347 context_, AsWeakPtr(), blob_storage_context, request_mode,
347 credentials_mode, redirect_mode, resource_type, 348 credentials_mode, redirect_mode, resource_type,
348 request_context_type, frame_type, body)); 349 request_context_type, frame_type, body,
350 dispatcher_host_ ? dispatcher_host_->url_loader_factory_callback()
351 : ServiceWorkerControlleeRequestHandler::
352 URLLoaderFactoryCallback()));
349 } 353 }
350 return std::unique_ptr<ServiceWorkerRequestHandler>(); 354 return std::unique_ptr<ServiceWorkerRequestHandler>();
351 } 355 }
352 356
353 ServiceWorkerObjectInfo 357 ServiceWorkerObjectInfo
354 ServiceWorkerProviderHost::GetOrCreateServiceWorkerHandle( 358 ServiceWorkerProviderHost::GetOrCreateServiceWorkerHandle(
355 ServiceWorkerVersion* version) { 359 ServiceWorkerVersion* version) {
356 DCHECK(dispatcher_host_); 360 DCHECK(dispatcher_host_);
357 if (!context_ || !version) 361 if (!context_ || !version)
358 return ServiceWorkerObjectInfo(); 362 return ServiceWorkerObjectInfo();
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 Send(new ServiceWorkerMsg_SetControllerServiceWorker( 678 Send(new ServiceWorkerMsg_SetControllerServiceWorker(
675 render_thread_id_, provider_id(), 679 render_thread_id_, provider_id(),
676 GetOrCreateServiceWorkerHandle( 680 GetOrCreateServiceWorkerHandle(
677 associated_registration_->active_version()), 681 associated_registration_->active_version()),
678 false /* shouldNotifyControllerChange */)); 682 false /* shouldNotifyControllerChange */));
679 } 683 }
680 } 684 }
681 } 685 }
682 686
683 } // namespace content 687 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698